Skip to content

Conversation

@JavierLopezT
Copy link
Contributor

Allow multiple statements executions and return info of executions SnowflakeHook

@boring-cyborg boring-cyborg bot added area:providers provider:snowflake Issues related to Snowflake provider labels Apr 1, 2021
else:
self.log.info(query)
cur.execute(query)
for row in cur.fetchall():
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
for row in cur.fetchall():
for row in cur:

More memory efficient.

# If autocommit was set to False for db that supports autocommit,
# or if db does not supports autocommit, we do a manual commit.
if not self.get_autocommit(conn):
conn.commit()
Copy link
Member

Choose a reason for hiding this comment

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

I believe the standard way to do this is on the cursor before closing instead. The get_autocommit() check is also not needed since commit() is a no-op in autocommit mode.

@github-actions
Copy link

github-actions bot commented Apr 1, 2021

The Workflow run is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.

@eladkal
Copy link
Contributor

eladkal commented May 7, 2021

The functionality was added in #15533

@eladkal eladkal closed this May 7, 2021
@JavierLopezT JavierLopezT deleted the snowflake_hook branch May 8, 2021 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:snowflake Issues related to Snowflake provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants