Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2457] [Bug] dbt deps commands error our in databricks DBFS #7428

Closed
2 tasks done
anjutiwari opened this issue Apr 21, 2023 · 2 comments · Fixed by #7447
Closed
2 tasks done

[CT-2457] [Bug] dbt deps commands error our in databricks DBFS #7428

anjutiwari opened this issue Apr 21, 2023 · 2 comments · Fixed by #7447
Assignees
Labels
bug Something isn't working dbfs Issues that only occur when dbt is running on the Databricks file system deps dbt's package manager file_system How dbt-core interoperates with file systems to read/write data help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors

Comments

@anjutiwari
Copy link
Contributor

anjutiwari commented Apr 21, 2023

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

dbt deps command fails to run in databricks DBFS.

  • deps command internally creating a symlink while running dbt deps command. After more debugging, I found dbt internally creating a symlink when installing dbt deps.

  • In current code the supports_symlinks is based on if python lib(os) has the symlink method available or not. https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/clients/system.py#L161

  • As DBT is running on 3.7+ Python we can get rid of supports_symlinks method. This will be always true in databricks DBFS because getattr(os, "symlink", None) will never return False with the python versions dbt supporting

  • DBFS can not work with symlink so we should use copytree.

https://stackoverflow.com/questions/64314341/creating-symbolic-link-in-a-databricks-filestores-folder
Screenshot 2023-04-21 at 3 38 03 pm

Expected Behavior

  • If symlink fails copy directory

Steps To Reproduce

  1. Install dbt under the DBFS path
  2. Run dbt deps command

Relevant log output

No response

Environment

- OS: NA (DBFS)
- Python: 3.8
- dbt: dbt-databricks==1.2.0

Which database adapter are you using with dbt?

other (mention it in "Additional Context")

Additional Context

No response

@anjutiwari anjutiwari added bug Something isn't working triage labels Apr 21, 2023
@github-actions github-actions bot changed the title [Bug] dbt deps commands error our in databricks DBFS [CT-2457] [Bug] dbt deps commands error our in databricks DBFS Apr 21, 2023
@jtcohen6 jtcohen6 added the deps dbt's package manager label Apr 21, 2023
@jtcohen6
Copy link
Contributor

@anjutiwari Thanks for opening! It's a relatively uncommon use case, but if the fix seems straightforward, I'm very happy to have you take a look :)

@jtcohen6 jtcohen6 added help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors and removed triage labels Apr 23, 2023
@anjutiwari
Copy link
Contributor Author

Hello @jtcohen6,
Thanks for looking into it. I have pushed my changes, please have a look.

@jtcohen6 jtcohen6 added file_system How dbt-core interoperates with file systems to read/write data dbfs Issues that only occur when dbt is running on the Databricks file system labels Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dbfs Issues that only occur when dbt is running on the Databricks file system deps dbt's package manager file_system How dbt-core interoperates with file systems to read/write data help_wanted Trickier changes, with a clear starting point, good for previous/experienced contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants