Skip to content
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

FIX: Fix error in write_dataframe if input has a date column and non-consecutive index values #325

Conversation

theroggy
Copy link
Member

@theroggy theroggy commented Nov 1, 2023

resolves #324

@theroggy theroggy marked this pull request as ready for review November 1, 2023 19:15
@theroggy theroggy changed the title FIX: error when writing a dataframe with a date column and non-consecutive index values FIX: Fix error in write_dataframe if input has a date column and non-consecutive index values Nov 1, 2023
Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on isolating the issue. I think the real fix needs to be something like

gdal_tz_offsets[name] = gdal_offset_representation => gdal_tz_offsets[name] = gdal_offset_representation.values on line 459 (geopandas.py)

So that we force it into a contiguous array where incremental indexing works.

@theroggy
Copy link
Member Author

theroggy commented Nov 1, 2023

That's indeed a cleaner solution... thanks.

Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @theroggy !

@brendan-ward brendan-ward merged commit 66738a0 into geopandas:main Nov 1, 2023
18 checks passed
@theroggy theroggy deleted the FIX-error-when-writing-a-dataframe-with-a-date-column-and-non-consecutive-index-values branch November 1, 2023 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: error when writing a dataframe with a date column and non-consecutive index values
2 participants