-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[BUGFIX] Update conditional for TextClause isinstance check in SQLAlchemyExecutionEngine #3844
[BUGFIX] Update conditional for TextClause isinstance check in SQLAlchemyExecutionEngine #3844
Conversation
✔️ Deploy Preview for niobium-lead-7998 ready! 🔨 Explore the source changes: 38ff2f1 🔍 Inspect the deploy log: https://app.netlify.com/sites/niobium-lead-7998/deploys/61b79b69d737ce0007200800 😎 Browse the preview: https://deploy-preview-3844--niobium-lead-7998.netlify.app |
HOWDY! This is your friendly 🤖 CHANGELOG bot 🤖Please don't forget to add a clear and succinct description of your change under the Develop header in ✨ Thank you! ✨ |
if TextClause and isinstance(selectable, TextClause): | ||
res = self.engine.execute( | ||
sa.select(query["select"]).select_from( | ||
selectable.columns().subquery() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very simple but if TextClause
is not imported properly, it is set to None
. isinstance(selectable, None)
causes an error because the second arg of isinstance
needs to be a type class (i.e. type(None)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nice work! Always love the type hinting.
Changes proposed in this pull request:
isinstance
checks onNone
result in an error; before doing this check, we need to make sure thatTextClause
was imported properly and is a valid typeDefinition of Done
Please delete options that are not relevant.
Thank you for submitting!