onelake_strategy
OneLakeStrategy
¶
Bases: FileRetrievalStrategy
Strategy for retrieving files from the OneLake.
Source code in src/cloe_nessy/file_utilities/strategies/onelake_strategy.py
get_file_paths(location, extension=None, search_subdirs=True, **kwargs)
staticmethod
¶
Recursively retrieves all files with a specified extension from a given directory and its subdirectories.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
str
|
Top-level directory to read from, e.g., '/Volumes/my_volume/landing/example_landing/'. |
required |
extension
|
str | None
|
File extension, e.g., 'csv', 'json'. Input an empty string to get files without any extension, input None to get all files. |
None
|
search_subdirs
|
bool
|
If True, function will also search within all subdirectories. |
True
|
kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
List |
list
|
List of files in the directory and its subdirectories with the given extension. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the location is not provided. |
Exception
|
For any other unexpected errors. |