The below code snippet is inside a function and the function is inside a class. I am using polars instead of pandas. I tried running the function and it showed me an error while performing the left join.
import polars as pl
inventory = pl.from_pandas(inventory)
# If a production order is provided, merge the inventory and production order information
if isinstance(self.production_order, pl.DataFrame) and (self.production_order.shape[0] > 0):
inventory = inventory.join(self.production_order,on='material_number', how='left')
I am getting the below error
ComputeError: Joins/or comparisons on categorical dtypes can only happen if they are created under the same global string cache.Hint: set a global StringCache
I tried using 'with pl.StringCache():' and then perform the join but it still shows the same error. What can I do to fix it?