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.
  • Loading branch information
potiuk committed Jul 21, 2023
1 parent 5b082c3 commit 00aa6ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion airflow/providers/apache/hive/hooks/hive.py
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 00aa6ea

Please sign in to comment.