We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
code snippet to reproduce: via doltcli write_rows(write_rows(dolt, "characters", TEST_ROWS, REPLACE, ["id"])
write_rows(write_rows(dolt, "characters", TEST_ROWS, REPLACE, ["id"])
or via doltpy: write_pandas(dolt, table_name, df, import_mode='replace')
write_pandas(dolt, table_name, df, import_mode='replace')
both call _import_helper which refers to
_import_helper
doltcli/doltcli/utils.py
Lines 251 to 265 in a807c93
the checks force it to return only create/update mode depending on the existence of the table, replace/force-create modes are ignored
create/update
replace/force-create
suggested change (MR #32 ) :
def _get_import_mode_and_flags( dolt: DoltT, table: str, import_mode: Optional[str] = None ) -> str: import_modes = IMPORT_MODES_TO_FLAGS.keys() if import_mode and import_mode not in import_modes: raise ValueError(f"update_mode must be one of: {import_modes}") elif import_mode: return import_mode else: if table in [table.name for table in dolt.ls()] and import_mode : logger.info(f'No import mode specified, table exists, using "{UPDATE}"') import_mode = UPDATE else: logger.info(f'No import mode specified, table exists, using "{CREATE}"') import_mode = CREATE return import_mode
The text was updated successfully, but these errors were encountered:
No branches or pull requests
code snippet to reproduce:
via doltcli
write_rows(write_rows(dolt, "characters", TEST_ROWS, REPLACE, ["id"])
or via doltpy:
write_pandas(dolt, table_name, df, import_mode='replace')
both call
_import_helper
which refers todoltcli/doltcli/utils.py
Lines 251 to 265 in a807c93
the checks force it to return only
create/update
mode depending on the existence of the table,replace/force-create
modes are ignoredsuggested change (MR #32 ) :
The text was updated successfully, but these errors were encountered: