Closed katieclaiborne-duet closed 1 month ago
Do you know why HOME
has forward slashes in it? And does Windows accept this?
We only use Mac here, so it might be tough to test for a fix, but I am thinking that instead of checking the HOME
env var, we could maybe check if in the graph
the file paths contain /
or \
.
Not sure of the why for this user, but it does appear that Windows can often accept either type of slash.
Checking the graph
seems like a promising idea!
For me this issue is happening on Windows using Git Bash, which takes forward slashes for everything.
edit: I just tried in PowerShell and I still get rows for fct_source_directories
for every model. So I guess Git Bash was not the cause.
edit 2: Snowflake
Could you try installing the package with the following syntax and see if it works?
packages:
- git: "https://github.com/dbt-labs/dbt-project-evaluator.git"
revision: "fix/os-identification"
If so, I can get it merged.
We've confirmed that the fix works!
Big thanks to @aarpatt1 for testing on his Windows machine, which has a HOME
environment variable that was previously returning a false (Mac) positive.
Great. I will check with the team to get it merged then.
Describe the bug
If a Windows user has set their
HOME
environment variable to use forward slashes, theget_directory_pattern
macro will falsely identify their machine as having a Mac / Linux operating system.As a result,
int_all_graph_resources
will derive directory and file paths incorrectly, and dependent rules likefct_source_directories
andfct_model_directories
will return test failures.Steps to reproduce
HOME
environment variable to use forward slashesExpected results
In
int_all_graph_resources
, I expecteddirectory_path
to be populated, andfile_name
to contain the name of the file following the last path separator.Actual results
Instead,
directory_path
is a blank string, andfile_name
contains the unchangedfile_path
value.Screenshots and log output
int_all_graph_resources
fct_model_directories
System information
The contents of your
packages.yml
file:Which database are you using dbt with?
The output of
dbt --version
:Additional context
Are you interested in contributing the fix?
Yes, although I'd likely need some guidance!