Skip to content

Commit

Permalink
Fix Pandas2 compatibility for Hive (#32752)
Browse files Browse the repository at this point in the history
Pandas2 removed deprecated iteritems() in a few classes with items()
being replacement pandas-dev/pandas#37545

The Hive Hook used iteritems when converting to dataframes.

Pandas2 upgrade has been enabled now by databricks-sql upgrade so
it is now possible to use Pandas2 and update our constraints.

GitOrigin-RevId: 00aa6ea72c4d72df6c62ac1dda9bb145bece2e1c
  • Loading branch information
potiuk authored and Cloud Composer Team committed May 15, 2024
1 parent e1a7c2d commit 560efc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/providers/apache/hive/hooks/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def _infer_field_types_from_df(df: pandas.DataFrame) -> dict[Any, Any]:
}

order_type = OrderedDict()
for col, dtype in df.dtypes.iteritems():
for col, dtype in df.dtypes.items():
order_type[col] = dtype_kind_hive_type[dtype.kind]
return order_type

Expand Down

0 comments on commit 560efc0

Please sign in to comment.