Skip to content

Fix: improve error message when a lib needs to be upgraded#1560

Merged
georgesittas merged 4 commits intomainfrom
jo/improve_diagnostic
Oct 11, 2023
Merged

Fix: improve error message when a lib needs to be upgraded#1560
georgesittas merged 4 commits intomainfrom
jo/improve_diagnostic

Conversation

@georgesittas
Copy link
Contributor

No description provided.

@georgesittas georgesittas requested a review from a team October 11, 2023 22:22
@georgesittas
Copy link
Contributor Author

georgesittas commented Oct 11, 2023

Just lowercased the lib to avoid displaying "SQLGlot" in the pip command. For example (before vs after):

➜  foo sqlmesh plan
======================================================================
Successfully Ran 1 tests against duckdb
----------------------------------------------------------------------
Error: SQLGlot (local) is using version '18.10.2.dev14' which is behind '18.11.6' (remote). Please upgrade SQLGlot ('pip install SQLGlot --upgrade' command).
➜  foo sqlmesh plan
======================================================================
Successfully Ran 1 tests against duckdb
----------------------------------------------------------------------
Error: SQLGlot (local) is using version '18.10.2.dev14' which is behind '18.11.6' (remote). Please upgrade SQLGlot ('pip install sqlglot --upgrade' command).

@eakmanrq
Copy link
Contributor

@georgesittas What do you think about providing the full command so they can just copy/paste?

@georgesittas
Copy link
Contributor Author

georgesittas commented Oct 11, 2023

@georgesittas What do you think about providing the full command so they can just copy/paste?

Which command do you mean? I think pip install sqlglot --upgrade suffices here for example right? (see example above)

Btw re: formatting, my intent here was also to copy the error message right above this one:

Please run a migration ('sqlmesh migrate' command)."

@eakmanrq
Copy link
Contributor

eakmanrq commented Oct 11, 2023

Well it doens't include the version in it. So if they just copy/paste that and SQLGlot is ahead then it will install the wrong version.

@georgesittas
Copy link
Contributor Author

Well it doens't include the version in it. So if they just copy/paste that and SQLGlot is ahead then it will install the wrong version.

Ah my bad, good catch. I'll fix this, thanks!

@georgesittas
Copy link
Contributor Author

Updated message:

➜  foo sqlmesh plan
======================================================================
Successfully Ran 1 tests against duckdb
----------------------------------------------------------------------
Error: SQLGlot (local) is using version '18.10.1' which is behind '18.12.0' (remote). Please upgrade SQLGlot ('pip install "sqlglot==18.12.0"' command).

@eakmanrq
Copy link
Contributor

@georgesittas Don't you need --upgrade included?

@georgesittas
Copy link
Contributor Author

georgesittas commented Oct 11, 2023

I thought the == forces the installation of that specific version? My impression was that --upgrade is required if we want to force-update even though the currently-used version is compatible with what we have specified in the project's package dependencies. Am I missing something?

EDIT: updated to include --upgrade anyway just to be sure.

@georgesittas georgesittas force-pushed the jo/improve_diagnostic branch from 9ab5bd2 to fdeec91 Compare October 11, 2023 23:02
@georgesittas georgesittas merged commit 19c5033 into main Oct 11, 2023
@georgesittas georgesittas deleted the jo/improve_diagnostic branch October 11, 2023 23:14
@eakmanrq
Copy link
Contributor

@georgesittas Ah you might be right. I just always do it. As you said it shouldn't hurt though.

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.

3 participants