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

Add a function to ad-hoc materialize a table for interactive debugging #117

Merged
merged 2 commits into from
Nov 14, 2023

Conversation

nicolasmueller
Copy link
Contributor

@nicolasmueller nicolasmueller commented Nov 3, 2023

Add pipedag.debug.materialize_table, a function to ad-hoc materialize a table from a task for interactive debugging

Checklist

  • Added a CHANGELOG.rst entry

Related issue: #116

@nicolasmueller nicolasmueller requested a review from a team as a code owner November 3, 2023 15:05
if table.name is None:
table.name = task.name + "_" + suffix
elif table.name.endswith("%%"):
table.name = table.name[:-2] + suffix
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 it would be nice to code share this name mangling with the original code that materializes tables. It will be more maintainable then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in 971ee05

debug_suffix: str | None = None,
flag_task_debug_tainted: bool = True,
keep_table_name: bool = True,
replace_table: bool = True,
Copy link
Member

Choose a reason for hiding this comment

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

The naming of replace_table might be optimized. Some dataframe materializations use if_exists="replace". This is a crude enum technique. However, people might be familiar with it. And we could raise an exception for all other string values.
Another alternative would be to rename it drop_if_exists. This would be closest to what this feature actually does and thus makes it easier to understand error messages reported by the database backend.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We now use drop_if_exists: 971ee05

@nicolasmueller nicolasmueller merged commit c5051cd into main Nov 14, 2023
22 checks passed
@nicolasmueller nicolasmueller deleted the debug_materialize branch November 14, 2023 16:09
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.

None yet

2 participants