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

Update metricflow dependencies #1246

Merged
merged 4 commits into from
Jun 5, 2024
Merged

Update metricflow dependencies #1246

merged 4 commits into from
Jun 5, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Jun 4, 2024

Description

This PR moves dependencies for metricflow so that they are shared with metricflow-semantics and makes some updates to put them in the proper sections.

@cla-bot cla-bot bot added the cla:yes label Jun 4, 2024
@plypaul plypaul force-pushed the p--py312--12 branch 4 times, most recently from 144d0bd to ea06513 Compare June 4, 2024 22:41
@plypaul plypaul marked this pull request as ready for review June 4, 2024 22:43
Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

I'm not convinced this will run unless the user happens to have graphviz installed, since metricflow_semantics uses it.

We only access this module in the CLI package so maybe we move it over there along with the graphviz dependency. Or else we can remove the graphviz rendering altogether, I don't think anybody's using it. It's cool and all, but eh.

Comment on lines 7 to 8
PyYAML>=6.0, <7.0.0
graphviz>=0.18.2, <0.21
Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't dev dependencies, are they? I'm not sure why we need pyYAML, but graphviz is referenced in our production package. As such, it should probably be in the metricflow-semantics dependency set, or at least listed as an optional dependency there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pyYAML is needed to parse YAML configuration files for tests. graphviz is used in the tests and the CLI. Let me put it back as a regular dependency until I figure out what to do with it.

pyproject.toml Outdated
@@ -113,11 +111,11 @@ MF_TEST_ADAPTER_TYPE="duckdb"
MF_SQL_ENGINE_URL="duckdb://"
# This allows us to use the classes in the `dbt-metricflow` package for tests without installing the package.
# `dbt-metricflow` can't be installed as it has `metricflow` as a dependency.
PYTHONPATH="./dbt-metricflow"
PYTHONPATH="metricflow-semantics:dbt-metricflow"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, nice, I see, so this should maybe make the install from the last PR editable? Let's give it a try!

@plypaul
Copy link
Contributor Author

plypaul commented Jun 5, 2024

Can you clarify what you mean by I'm not convinced this will run?

@tlento
Copy link
Contributor

tlento commented Jun 5, 2024

I think if you try to use the CLI without a separate installation of graphviz the import will fail and metricflow won't load.

@plypaul
Copy link
Contributor Author

plypaul commented Jun 5, 2024

Yeah, prior to the latest commit, that would have been the case. Now that graphviz is a dependency of metricflow-semantics (as that's where the usage is), it should be good.

Copy link
Contributor

@tlento tlento left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

Graphviz appears to have basically no dependencies so maybe we just keep it there until somebody hits a version conflict, but since they haven't had a minor version release since 2022 I don't think this is an issue.

We can also make it optional, condition the import appropriately, and then make the CLI package pull in the optional dep from metricflow-semantics, but I'm more inclined to move the relevant module and maybe rename that one graphviz_whatever property we have floating around - I looked at the logic and it's portable, the only unpleasant thing is it adds a typing dependency on the DagNode class, but when we harden the API we can replace that with some kind of MFDagNode protocol.

@plypaul plypaul force-pushed the p--py312--12 branch 2 times, most recently from 73c97e8 to 6a46f13 Compare June 5, 2024 22:45
Base automatically changed from p--py312--11 to main June 5, 2024 22:49
plypaul added 4 commits June 5, 2024 16:34
Some of the dependencies listed for `metricflow` should instead be dependecies
in `metricflow-semantics` or part of the dev environment.
Dependencies between `metricflow` and `metricflow-semantics` should largely be
the same.
@plypaul plypaul enabled auto-merge (squash) June 5, 2024 23:36
@plypaul plypaul merged commit 486bcf8 into main Jun 5, 2024
15 checks passed
@plypaul plypaul deleted the p--py312--12 branch June 5, 2024 23:38
@plypaul plypaul restored the p--py312--12 branch June 5, 2024 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants