fix: Fix pandas 2.x compatibility issue of Trino offline store caused by removed Series.iteritems() method #5345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an
AttributeError
encountered when usingfeast.get_historical_features()
with Trino as offline store andpandas>=2.0.0
, whereSeries.iteritems()
has been removed. The code now usesrow.items()
, which is compatible with both older and newer pandas versions.What this PR does / why we need it:
Feast with Trino as offline store currently breaks when used with pandas 2.x due to the removal of
Series.iteritems()
. This simple change ensures compatibility with modern pandas versions while retaining backwards compatibility with <2.0.0.So users don't have to add
pandas>=1.5.3,<2.0.0
torequirements.txt
, this PR will replace iteritems() method with items() for pandas 2.x compatibility in Trino offline store connector.Which issue(s) this PR fixes:
N/A — this issue was found independently and not yet tracked.
Misc
This PR ensures compatibility with
pandas >= 0.23.0
when calling historical feature retrieval function with Trino offline store.Realese note: Fix pandas 2.x compatibility issue of Trino offline store caused by removed Series.iteritems() method