Skip to content

Commit

Permalink
Add FileStorage.get_dir_name_from_file_path
Browse files Browse the repository at this point in the history
  • Loading branch information
sultaniman committed Mar 28, 2024
1 parent 07ffa19 commit 28e4268
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dlt/common/storages/file_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ def from_relative_path_to_wd(self, relative_path: str) -> str:
def get_file_name_from_file_path(file_path: str) -> str:
return os.path.basename(file_path)

@staticmethod
def get_dir_name_from_file_path(file_path: str) -> str:
return os.path.dirname(file_path)

@staticmethod
def validate_file_name_component(name: str) -> None:
# Universal platform bans several characters allowed in POSIX ie. | < \ or "COM1" :)
Expand Down

0 comments on commit 28e4268

Please sign in to comment.