Skip to content

Commit

Permalink
Replace deprecated method iteritems() for pandas
Browse files Browse the repository at this point in the history
With new pandas version 2.0.0, the attribute was removed, retrieving an error.

Reference: https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#removal-of-prior-version-deprecations-changes
  • Loading branch information
LuighiV committed Apr 6, 2023
1 parent fcd5b9c commit 3d190aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion csvs_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def get_create_table_sql(
# http://pandas.pydata.org/pandas-docs/stable/gotchas.html#support-for-integer-na
sql_type_overrides = sql_type_overrides or {}
if isinstance(df, pd.DataFrame):
columns_and_types = df.dtypes.iteritems()
columns_and_types = df.dtypes.items()
elif isinstance(df, pd.Series):
columns_and_types = [(df.name, df.dtype)]
for column, dtype in columns_and_types:
Expand Down

0 comments on commit 3d190aa

Please sign in to comment.