-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'float' object cannot be interpreted as an integer #2224
Comments
So I'm not sure if this is the same issue, but I remember once that infinity is a valid float in python but not JSON, it's possible something related is going on |
@datajoely thank you very much for your answer! I've investigated the dataset I had and actually found that the issue happens with the timestamp of type Here is the minimal dataframe which reproduces the error on my side: test_df = pd.DataFrame({
'timestamp_col': [pd.Timestamp('2024-12-11 18:00:00'), pd.NaT]
})
test_df.to_parquet('data/01_raw/dataset_name.parquet') Produces exactly the same error: TypeError: 'float' object cannot be interpreted as an integer |
So that's interesting - but does that mean you were able to save the data that Kedro-Viz was trying to read? |
@datajoely, yes. Kedro pipeline does this without any changes. I've also tried to save such a dataframe using pyre pandas from the example above - both work. I haven't specified any configuration for the parquet, but I have fastparquet and pyarrow installed in the venv. So should use pyarrow with snappy compression by default, but I haven't checked into the depth if this may cause any issues |
Is this a ParquetDataset? If so, Kedro-Viz uses the To handle edge cases, like missing or problematic values (NaT, inf, etc.), you could clean the data table before previewing it. The |
Description
I run kedro viz and as soon as I press onto one of the datasets persisted in memory, the application fails with the
TypeError: 'float' object cannot be interpreted as an integer
Context
This issue makes all the consecutive datasets not available for a preview. Apart from that, there is no direct way to understand which exact column of the dataset persisted as parquet doesn't fit.
Steps to Reproduce
catalog.load
Expected Result
Preview is available
Actual Result
Long error starting with
and ending with
Your Environment
Include as many relevant details as possible about the environment you experienced the bug in:
Checklist
The text was updated successfully, but these errors were encountered: