Skip to content
New issue

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

refactor: add overwrite option #573

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cornzyblack
Copy link
Contributor

Changes

Added the overwrite parameter for the _FsUtil.cp function for this issue -> #548

  • make test run locally
  • make fmt applied
  • relevant integration tests applied

@cornzyblack
Copy link
Contributor Author

cornzyblack commented Mar 2, 2024

A snippet of the failing test from databricks-sdk-py/tests/test_dbutils.py

    dbutils.fs.cp("a", "b", recurse=True)
    inner.assert_called_with("a", "b", recursive=True)

Tests fail because the modified dbutils.fs.cp function has a new parameter called overwrite. However, when it is called in the tests, the assert_called_with checks all arguments to the function, missing the new default overwrite=False argument.

A fix for this is to modify the assert_called_with to have the overwrite=False argument.

    dbutils.fs.cp("a", "b", recurse=True)
    inner.assert_called_with("a", "b", recursive=True, overwrite=False)

@cornzyblack
Copy link
Contributor Author

Closes #548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant