Skip to content

Reflect column comments#186

Merged
jklukas merged 2 commits into
sqlalchemy-redshift:masterfrom
eeshugerman:master
Dec 17, 2019
Merged

Reflect column comments#186
jklukas merged 2 commits into
sqlalchemy-redshift:masterfrom
eeshugerman:master

Conversation

@eeshugerman
Copy link
Copy Markdown
Contributor

@eeshugerman eeshugerman commented Dec 14, 2019

Todos

  • MIT compatible
  • Tests
  • Documentation -- N/A I think?
  • Updated CHANGES.rst

Comment thread CHANGES.rst

- Expose supported types for import from the dialect
(`Issue #181 <https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/issues/181>`_)
- Reflect column comments
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no GitHub issue... should I create one?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Linking to the PR is fine.

Comment thread CHANGES.rst
kw.pop('comment', None)
if sa.__version__ < '1.2.0':
# SQLAlchemy 1.2.0 introduced the 'comment' param
del kw['comment']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you explain why we need to invert this condition here? Is there ever a possibility that 'comment' will not exist in kwargs, and this could raise an exception?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, the only place this method is called is on line ~480 (above), and I've added the comment kwarg there, so this will never raise a KeyError.

It makes sense to invert the condition because otherwise it would be something like

if sa.__version__ >= '1.2.0':
    pass
else:
    del kw['comment']

Co-Authored-By: Jeff Klukas <jeff@klukas.net>
@jklukas jklukas merged commit ab2df16 into sqlalchemy-redshift:master Dec 17, 2019
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.

2 participants