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!: error when trying to construct source queries from empty DFs #2795

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

georgesittas
Copy link
Contributor

@georgesittas georgesittas commented Jun 19, 2024

Fixes #2769

@georgesittas georgesittas requested a review from a team June 19, 2024 17:13
"is commonly related to Python models that produce no data.\nFor such "
"models, consider yielding from an empty generator if the resulting set "
"\nis empty, i.e. use `yield from ()`"
) in capsys.readouterr().out
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested this using capsys because if I do pytest.raises(SQLMeshError, match=...) it captures the Plan application failed. exception which doesn't include the exception of interest in its context.

@georgesittas georgesittas force-pushed the jo/handle_empty_df_in_source_queries branch from 3ff7ba1 to 3f6d15f Compare June 20, 2024 12:33
@georgesittas georgesittas merged commit 34f59f8 into main Jun 20, 2024
15 checks passed
@georgesittas georgesittas deleted the jo/handle_empty_df_in_source_queries branch June 20, 2024 16:49
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.

Empty Python model DataFrames can lead to no-op EngineAdapter.ctas calls
3 participants