Skip to content

[DOP-5429] Add rename_dir method#40

Merged
dolfinus merged 1 commit intodevelopfrom
feature/DOP-5429
May 24, 2023
Merged

[DOP-5429] Add rename_dir method#40
dolfinus merged 1 commit intodevelopfrom
feature/DOP-5429

Conversation

@dolfinus
Copy link
Member

@dolfinus dolfinus commented May 22, 2023

  • Added mixin RenameDirMixin. It contains rename_dir method implementation and _rename_dir abstract method which should be implemented by inherited class (usually just the same as _rename_file).
  • Added corresponding protocol SupportRenameDir
  • Added new exception type DirectoryExistsError which is raised if someone tries to use some existing directory name as target name and if replace=False
  • Added this mixin to FTP, FTPS, HDFS and SFTP. S3 does not have directories and corresponding method in client. That's why this method not in the BaseFileConnection interface
  • Added test for new method with all parameter combinations

@dolfinus dolfinus force-pushed the feature/DOP-5429 branch 3 times, most recently from bbac79b to c9edfd5 Compare May 22, 2023 13:25
@dolfinus dolfinus marked this pull request as ready for review May 22, 2023 13:34
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #40 (822c0c6) into develop (cbd51d0) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #40      +/-   ##
===========================================
+ Coverage    92.61%   92.66%   +0.05%     
===========================================
  Files          109      112       +3     
  Lines         5401     5440      +39     
  Branches       941      943       +2     
===========================================
+ Hits          5002     5041      +39     
  Misses         309      309              
  Partials        90       90              
Impacted Files Coverage Δ
onetl/base/__init__.py 100.00% <100.00%> (ø)
onetl/base/supports_rename_dir.py 100.00% <100.00%> (ø)
onetl/connection/file_connection/ftp.py 96.20% <100.00%> (+0.09%) ⬆️
onetl/connection/file_connection/hdfs.py 95.87% <100.00%> (+0.03%) ⬆️
...netl/connection/file_connection/mixins/__init__.py 100.00% <100.00%> (ø)
...nection/file_connection/mixins/rename_dir_mixin.py 100.00% <100.00%> (ø)
onetl/connection/file_connection/sftp.py 85.95% <100.00%> (+0.23%) ⬆️
onetl/connection/file_connection/webdav.py 97.19% <100.00%> (+0.05%) ⬆️
onetl/exception.py 100.00% <100.00%> (ø)

@dolfinus dolfinus force-pushed the feature/DOP-5429 branch from c9edfd5 to 822c0c6 Compare May 23, 2023 11:07
@dolfinus dolfinus merged commit fc60afa into develop May 24, 2023
@dolfinus dolfinus deleted the feature/DOP-5429 branch May 24, 2023 13:00
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.

3 participants