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

Move MetricFlow CLI package to dbt-metricflow #1099

Merged
merged 3 commits into from
Mar 26, 2024
Merged

Conversation

tlento
Copy link
Contributor

@tlento tlento commented Mar 22, 2024

As we move towards making MetricFlow a stand-alone
library for building queries and rendering SQL, it makes
sense to remove any direct query execution components and
their attendant dependencies. For dependency management and package
deployment purposes, we are particularly interested in removing the
dbt-core dependencies from the production MetricFlow package.

The lone production component relying on dbt-core is the
MetricFlow CLI. In order to expedite our dependency refinement we
take the step of moving the CLI under dbt-metricflow here.

The packaging update here is as minimal as possible - there are a
load of problems with this layout, not least of which is we need to
do some pretty janky editable install operations in all of our test
environments and duplicate dependencies across the two packages just
to keep dev tools working.

In the long run, we should move to a more refined packaging model that
allows us to execute the MetricFlow test suite using the local
library with a stand-alone SqlClient built for testing AND to run the
same test suite using our supported adapter packages via dbt-metricflow.
Doing this requires us to:

  1. Overhaul our test package and fixture setups
  2. Refine MetricFlow's APIs so they can be simply invoked from whatever
    components in dbt-metricflow require them (e.g., the CLI)
  3. Re-organize our repo packaging setup to, at a minimum, move the CLI
    tests under dbt-metricflow

While none of this is hard, exactly, it's a lot of effort that we don't
have the time to make at this time, so instead we have a janky package
layout and rely on a few questionable dev environment management practices.

MetricFlow has not allowed Pandas installs pre-1.1 since maybe
ever, so keeping a packaging.version parse check and special
casing for CLI output doesn't seem worth the effort.

Note the `packaging` module was only available via a transitive
dependency, so this could have broken at any time.
As we move towards making MetricFlow a stand-alone
library for building queries and rendering SQL, it makes
sense to remove any direct query execution components and
their attendant dependencies. For dependency management and package
deployment purposes, we are particularly interested in removing the
dbt-core dependencies from the production MetricFlow package.

The lone production component relying on dbt-core is the
MetricFlow CLI. In order to expedite our dependency refinement we
take the step of moving the CLI under dbt-metricflow here.

The packaging update here is as minimal as possible - there are a
load of problems with this layout, not least of which is we need to
do some pretty janky editable install operations in all of our test
environments and duplicate dependencies across the two packages just
to keep dev tools working.

In the long run, we should move to a more refined packaging model that
allows us to execute the MetricFlow test suite using the local
library with a stand-alone SqlClient built for testing AND to run the
same test suite using our supported adapter packages via dbt-metricflow.
Doing this requires us to:

1. Overhaul our test package and fixture setups
2. Refine MetricFlow's APIs so they can be simply invoked from whatever
components in dbt-metricflow require them (e.g., the CLI)
3. Re-organize our repo packaging setup to, at a minimum, move the CLI
tests under dbt-metricflow

While none of this is hard, exactly, it's a lot of effort that we don't
have the time to make at this time, so instead we have a janky package
layout and rely on a few questionable dev environment management practices.

separate the production dependencies
Some lint errors cropped up in CI which could not be reproduced
locally, perhaps due to platform-related differences in versioning
or parsing for the associated tools.

This commit seeks to resolve those discrepancies by doing the following:

1. Removing the file path restrictions in the .pre-commit-config.yaml
2. Marking dbt_metricflow as a known first party package for isort

All other changes are the result of running the linter with autofix
enabled and these new settings in place.
@tlento tlento added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Mar 22, 2024
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS March 22, 2024 20:41 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS March 22, 2024 20:41 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS March 22, 2024 20:41 — with GitHub Actions Inactive
@tlento tlento temporarily deployed to DW_INTEGRATION_TESTS March 22, 2024 20:41 — with GitHub Actions Inactive
@tlento tlento marked this pull request as ready for review March 22, 2024 20:49
@github-actions github-actions bot removed the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Mar 22, 2024
Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

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

Awesome! All makes sense to me! 🚀

Base automatically changed from clean-up-package-distribution to main March 26, 2024 22:02
@tlento tlento merged commit 72333ca into main Mar 26, 2024
23 checks passed
@tlento tlento deleted the move-cli-to-dbt-metricflow branch March 26, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SL-1876] Move the CLI and other adapter/dbt-core dependent components into dbt-metricflow.
2 participants