Skip to content

Conversation

@jayantsing-db
Copy link
Contributor

Introduces a new ignore_transactions configuration parameter (default: True) to control transaction-related behavior in the Connection class.

When ignore_transactions=True (default):

  • commit(): no-op, returns immediately
  • rollback(): raises NotSupportedError with message "Transactions are not supported on Databricks"
  • autocommit setter: no-op, returns immediately

When ignore_transactions=False:

  • All transaction methods execute normally

Changes:

  • Added ignore_transactions parameter to Connection.init() with default value True
  • Modified commit(), rollback(), and autocommit setter to check ignore_transactions flag
  • Updated unit tests to pass ignore_transactions=False when testing transaction functionality
  • Updated e2e transaction tests to pass ignore_transactions=False
  • Added three new unit tests to verify ignore_transactions

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

Introduces a new `ignore_transactions` configuration parameter (default: True)
to control transaction-related behavior in the Connection class.

When ignore_transactions=True (default):
- commit(): no-op, returns immediately
- rollback(): raises NotSupportedError with message "Transactions are not supported on Databricks"
- autocommit setter: no-op, returns immediately

When ignore_transactions=False:
- All transaction methods execute normally

Changes:
- Added ignore_transactions parameter to Connection.__init__() with default value True
- Modified commit(), rollback(), and autocommit setter to check ignore_transactions flag
- Updated unit tests to pass ignore_transactions=False when testing transaction functionality
- Updated e2e transaction tests to pass ignore_transactions=False
- Added three new unit tests to verify ignore_transactions
@github-actions
Copy link

Thanks for your contribution! To satisfy the DCO policy in our contributing guide every commit message must include a sign-off message. One or more of your commits is missing this message. You can reword previous commit messages with an interactive rebase (git rebase -i main).

@jayantsing-db
Copy link
Contributor Author

Hey @vikrantpuppala, just an FYI, when the flag is set to false, the autocommit getter will return true. I wasn’t entirely sure which default made the most sense, but true seems more appropriate. Airflow jobs shouldn’t break with this behavior, but could you double-check as well? I’ve already verified on my end.

@vikrantpuppala vikrantpuppala merged commit a4899cb into main Nov 20, 2025
27 of 30 checks passed
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