Skip to content

Conversation

@smackesey
Copy link
Collaborator

@smackesey smackesey commented Apr 22, 2025

Summary & Motivation

Exit with an error when the dg version is less than the dagster in the in-scope environment. We have to transform the "core version" of dagster to a "library version" in order to perform the comparison.

The check is run whenever we spawn a dagster-components subprocess.

How I Tested These Changes

New unit tests.

Changelog

dg will now fail with an error message if it's version is below the minimum supported version for the version of dagster in your environment.

Copy link
Collaborator Author

smackesey commented Apr 22, 2025

@smackesey smackesey marked this pull request as ready for review April 22, 2025 22:18
@smackesey smackesey changed the title [dg] Warn on dg less than dagster (BUILD-1041) [dg] Fail on dagster-dg version less than dagster version (BUILD-1041) Apr 22, 2025
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch 3 times, most recently from b1eaa15 to f005d06 Compare April 23, 2025 14:43
@smackesey smackesey force-pushed the sean/dg/warn-on-outdated-dg branch from 7115b58 to bc9aa28 Compare April 23, 2025 14:43
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from f005d06 to 4022708 Compare April 23, 2025 15:05
@smackesey smackesey force-pushed the sean/dg/warn-on-outdated-dg branch 2 times, most recently from 10db195 to 54187a2 Compare April 23, 2025 15:40
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from 4022708 to 6d831b4 Compare April 23, 2025 15:40
@smackesey smackesey force-pushed the sean/dg/warn-on-outdated-dg branch from 54187a2 to c4e63c4 Compare April 23, 2025 15:47
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from 6d831b4 to f743661 Compare April 23, 2025 15:47
@smackesey smackesey force-pushed the sean/dg/warn-on-outdated-dg branch from c4e63c4 to 8c10dc6 Compare April 23, 2025 16:23
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from 424530f to 3ab6f73 Compare April 23, 2025 16:23
Copy link
Member

@gibsondan gibsondan left a comment

Choose a reason for hiding this comment

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

Implementation seems fine but i'm worried the error isn't clear enough about what's happening

if dagster_dg_version < minimum_dagster_dg_version:
exit_with_error(
f"""
dagster-dg version is incompatible with the installed version of dagster.
Copy link
Member

Choose a reason for hiding this comment

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

I think the copy here could be wordsmithed a bit. This reads to me like a problem with the venv in which dg is running, as opposed to a compatibility problem between two different venvs.

@smackesey smackesey requested a review from gibsondan April 23, 2025 17:23
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from 3ab6f73 to b258773 Compare April 23, 2025 17:23
@smackesey smackesey force-pushed the sean/dg/warn-on-outdated-dg branch from 8c10dc6 to 5bbe1e2 Compare April 23, 2025 17:23
if dagster_dg_version < minimum_dagster_dg_version:
exit_with_error(
textwrap.dedent(f"""
Current `dg` version is incompatible with `dagster-components` version in the resolved environment.
Copy link
Member

Choose a reason for hiding this comment

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

Can we drop the reference to dagster-components CLI entirely, or at least in the preamble? That feels like an implementation detail and IMO reads at first like it refers to a separate dagster-components package.

Current dg version is incompatible with dagster version in the resolved environment. dg communicates across a process boundary with dagster. Found versions:

(Maybe this is a reason to rename the dagster-components entrypoint entirely)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah changed it-- we should probably just fold dagster-components onto a dg-server subcommand of dagster or something.

@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from b258773 to aebd2fe Compare April 23, 2025 17:37
Base automatically changed from sean/dg/warn-on-outdated-dg to master April 23, 2025 20:26
smackesey and others added 2 commits April 23, 2025 16:26
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@smackesey smackesey force-pushed the sean/dg/warn-on-dg-less-than-dagster branch from aebd2fe to 2622ef1 Compare April 23, 2025 20:26
@smackesey smackesey merged commit c150a6c into master Apr 23, 2025
5 checks passed
@smackesey smackesey deleted the sean/dg/warn-on-dg-less-than-dagster branch April 23, 2025 20:53
smackesey added a commit that referenced this pull request Apr 23, 2025
#29505)

## Summary & Motivation

Exit with an error when the `dg` version is less than the dagster in the
in-scope environment. We have to transform the "core version" of
`dagster` to a "library version" in order to perform the comparison.

The check is run whenever we spawn a `dagster-components` subprocess.
## How I Tested These Changes

New unit tests.

## Changelog

`dg` will now fail with an error message if it's version is below the
minimum supported version for the version of `dagster` in your
environment.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
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.

4 participants