You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DBT config yaml
Working with the magician on different operating systems (Win, Unix, Mac), we discovered that the paths to dbt models are saved differently in yaml files depending on this. for example, dbts\run_all.yaml in Win. Is it possible to make path formation independent of the operating system, at least when reading the config or running the pipeline?
Solution
Using pathlib instead of os.path
Refactoring File class methods (git)
Example
from pathlib import Path, PureWindowsPath
from platform import system
class AgnosticPath(Path):
def __new__(cls, *args, **kwargs):
new_path = PureWindowsPath(*args).parts
if (system() != "Windows") and (len(new_path) > 0) and (new_path[0] in ("/", "\\")):
new_path = ("/", *new_path[1:])
return super().__new__(Path, *new_path, **kwargs)
The text was updated successfully, but these errors were encountered:
DBT config yaml
Working with the magician on different operating systems (Win, Unix, Mac), we discovered that the paths to dbt models are saved differently in yaml files depending on this. for example,
dbts\run_all.yaml
in Win. Is it possible to make path formation independent of the operating system, at least when reading the config or running the pipeline?https://files.slack.com/files-pri/T03GK6PEQP6-F0727SEC9FF/image.png
https://files.slack.com/files-pri/T03GK6PEQP6-F0727SBMN0M/image.png
Solution
Using pathlib instead of os.path
Refactoring File class methods (git)
Example
The text was updated successfully, but these errors were encountered: