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

Upsert Dag/Task History #95

Open
fritz-astronomer opened this issue Mar 15, 2024 · 0 comments
Open

Upsert Dag/Task History #95

fritz-astronomer opened this issue Mar 15, 2024 · 0 comments
Assignees

Comments

@fritz-astronomer
Copy link
Contributor

fritz-astronomer commented Mar 15, 2024

Was previously excluded to make things simpler - we may be able to attempt to upsert, and fall back to insert if we can't. This may be a hassle, depending on what sqlalchemy versions the syntax is/isn't available with 🤔 but this might work

try:
    from sqlalchemy.dialects.postgresql import insert
    self.session.execute(
        insert(table).values(items).on_conflict_do_nothing()
    )
except ImportError:
    self.session.execute(
        table.insert().values(items)
    )
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

When branches are created from issues, their pull requests are automatically linked.

2 participants