Skip to content

Commit 14c2b03

Browse files
authored
Replace deprecated argument error_bad_lines and method iteritems() for pandas (#92)
* Replace deprecated argument `error_bad_lines` for pandas With new pandas version 2.0.0, the argument was removed, retrieving an error. Reference: https://pandas.pydata.org/docs/whatsnew/v2.0.0.html#removal-of-prior-version-deprecations-changes * Replace deprecated method `iteritems()` for pandas 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
1 parent 1a7a9df commit 14c2b03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csvs_to_sqlite/utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def load_csv(
3939
filepath,
4040
sep=separator,
4141
quoting=quoting,
42-
error_bad_lines=not skip_errors,
42+
on_bad_lines='skip' if skip_errors else 'error',
4343
low_memory=True,
4444
encoding=encoding,
4545
usecols=usecols,
@@ -284,7 +284,7 @@ def get_create_table_sql(
284284
# http://pandas.pydata.org/pandas-docs/stable/gotchas.html#support-for-integer-na
285285
sql_type_overrides = sql_type_overrides or {}
286286
if isinstance(df, pd.DataFrame):
287-
columns_and_types = df.dtypes.iteritems()
287+
columns_and_types = df.dtypes.items()
288288
elif isinstance(df, pd.Series):
289289
columns_and_types = [(df.name, df.dtype)]
290290
for column, dtype in columns_and_types:

0 commit comments

Comments
 (0)