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

🐞 latest version of palm-dbt does not install macros #30

Closed
emekdahl opened this issue Dec 2, 2021 · 8 comments
Closed

🐞 latest version of palm-dbt does not install macros #30

emekdahl opened this issue Dec 2, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@emekdahl
Copy link

emekdahl commented Dec 2, 2021

Describe the bug
As a palm-dbt user, I expect the latest version of palm-dbt will install the macros I need to run the dbt projects. However, when I attempt to install them I get the error below.

Your environment

  • palm version: 2.1.0
  • palm-dbt version: 0.0.4
  • OS:
  • Docker version:
  • Other dependencies & versions:

How to reproduce

python3 -m pip uninstall palm || true
python3 -m pip uninstall palm-dbt || true
pip install palm
pip install palm-dbt
cd jaffle_shop
palm init -p dbt

Expected behavior
palm install installs macros

Actual behavior

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/palm", line 8, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/plugins/dbt/commands/cmd_install.py", line 39, in cli
    shutil.copy(Path(macro_template_path, macro), Path(macros_path, macro))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 415, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shutil.py", line 261, in copyfile
    with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/plugins/dbt/macros/drop_branch_schemas.sql'

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@emekdahl emekdahl added the bug Something isn't working label Dec 2, 2021
@emekdahl emekdahl changed the title 🐞 New Bug 🐞 latest version of palm-dbt does not install macros Dec 2, 2021
@jakeberesford-palmetto
Copy link
Collaborator

I'm on it

@jakeberesford-palmetto
Copy link
Collaborator

I just attempted to reproduce the issue and was able to palm install without this error. Could you share the output of palm plugin versions from within your jaffle shop repo?

@emekdahl
Copy link
Author

emekdahl commented Dec 2, 2021

(base) ➜ jaffle_shop git:(coalesce-2021) ✗ palm --version
palm, version 2.1.0
(base) ➜ jaffle_shop git:(coalesce-2021) ✗ palm plugin versions
dbt: 0.0.4
(base) ➜ jaffle_shop git:(coalesce-2021) ✗

@jakeberesford-palmetto
Copy link
Collaborator

Ok, you should be on palm-dbt version 0.1.0. Can you try pip uninstall palm-dbt && pip install palm-dbt --no-cache-dir?

@emekdahl
Copy link
Author

emekdahl commented Dec 2, 2021

Okay, I did that for both palm and palm-dbt. This also looks like an issue that we already resolved which suggests that somehow the uninstall / reinstall didn't work as expected.

No palm config found in .palm/config.yml, please run 'palm scaffold config'
Some palm commands may not work correctly without palm config
Success! Project initialized with Palm CLI
(base) ➜  jaffle_shop git:(coalesce-2021) ✗ palm install
Palm dbt macros installed!
(base) ➜  jaffle_shop git:(coalesce-2021) ✗ palm containerize
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/bin/palm", line 8, in <module>
    sys.exit(cli())
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1254, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/click/core.py", line 1297, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/cli.py", line 72, in get_command
    spec.loader.exec_module(mod)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/plugins/dbt/commands/cmd_containerize.py", line 3, in <module>
    from palm.plugins.dbt.dbt_containerizer import DbtContainerizer
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/plugins/dbt/dbt_containerizer.py", line 9, in <module>
    class DbtContainerizer(PythonContainerizer):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/palm/plugins/dbt/dbt_containerizer.py", line 43, in DbtContainerizer
    def validate_dbt_version(self) -> tuple[bool, str]:
TypeError: 'type' object is not subscriptable
(base) ➜  jaffle_shop git:(coalesce-2021) ✗ palm --version
palm, version 2.1.0
(base) ➜  jaffle_shop git:(coalesce-2021) ✗ palm plugin versions
dbt: 0.1.0
(base) ➜  jaffle_shop git:(coalesce-2021) ✗ ```

@jakeberesford-palmetto
Copy link
Collaborator

This looks like an issue with type hints in python <3.9 - we will need to release a patch for this

@ethanknox-palmetto
Copy link
Contributor

dammit how did the tests not catch that? it's either tuple (the actual obj) or Tuple[bool, str] (the typing class ie from typing import Tuple

@emekdahl
Copy link
Author

emekdahl commented Dec 2, 2021

This was resolved in 0.1.1

@emekdahl emekdahl closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants