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

Refactor CLI setup #194

Merged
merged 9 commits into from
Dec 12, 2023
Merged

Refactor CLI setup #194

merged 9 commits into from
Dec 12, 2023

Conversation

gouline
Copy link
Owner

@gouline gouline commented Dec 8, 2023

  • Refactor Click CLI setup, including the following breaking changes:
    • Options are now separated with hyphens, not underscores (e.g. --dbt_database becomes --dbt-database)
    • Lists are now separated with commas, not spaces (e.g. --dbt-includes model1 model2 becomes --dbt-includes model1,model2)
    • Metabase environment variables now prefixed with METABASE_ instead of MB_
    • Interactive config generation has been removed (used to be invoked via dbt-metabase config)
    • Miscellaneous options were renamed for clarity (e.g. --dbt-path is now --dbt-project-path)
  • Support for custom config file, in addition to the default location ~/.dbt-metabase/config.yml in the same format (e.g. dbt-metabase --config-file path/to/config.yml models)
  • Migrate from script to entry_points in setup.py for better cross-platform support

@gouline gouline marked this pull request as ready for review December 12, 2023 02:50
@gouline gouline merged commit 483f294 into master Dec 12, 2023
1 check passed
@gouline gouline deleted the refactor-cli branch December 12, 2023 02:57
Comment on lines -286 to -292
@click.option(
"--http_extra_headers",
cls=OptionAcceptableFromConfig,
type=(str, str),
multiple=True,
help="Additional HTTP request header to be sent to Metabase.",
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I see that this part has been removed from the new version 1.0.0, is it expected?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still available in the programmatic API. I couldn't get the dictionary type to work via CLI flag, were you using it via config YAML file?

Copy link
Owner Author

@gouline gouline Jan 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Released in v1.0.1, you can now use:

dbt-metabase [COMMAND]
  --http-header x-some-header-1 some-value-1
  --http-header x-some-header-2 some-value-2

or via YAML config:

config:
  http_headers:
    - [x-some-header-1, some-value-1]
    - [x-some-header-2, some-value-2]

@tanguyantoine
Copy link
Contributor

That was fast, thank you 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants