Skip to content

Fix unicode issue with SORTKEY on python 2#34

Merged
graingert merged 1 commit into
sqlalchemy-redshift:masterfrom
bouk:check-unicode
Sep 1, 2015
Merged

Fix unicode issue with SORTKEY on python 2#34
graingert merged 1 commit into
sqlalchemy-redshift:masterfrom
bouk:check-unicode

Conversation

@bouk
Copy link
Copy Markdown
Contributor

@bouk bouk commented Sep 1, 2015

This is to make sure unicode is supported in python2

@graingert

Comment thread tests/test_ddl_compiler.py Outdated
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.

You can use u'id' and this will work on both

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.

fixed

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.

The lint test runs on python 3 and throws an error for this unicode.

@jklukas
Copy link
Copy Markdown
Member

jklukas commented Sep 1, 2015

+1

Comment thread redshift_sqlalchemy/dialect.py Outdated
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.

When was this added to sqlalchemy? Is it considered public?

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.

hmm looking at it it's definitely not public. What would be the best way to go about this? If I were to copy over the code, the linter would complain about unicode or basestring

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.

What about a compat.py with a # noqa line?

@bouk bouk force-pushed the check-unicode branch 3 times, most recently from c30d2f6 to f705281 Compare September 1, 2015 20:50
@bouk
Copy link
Copy Markdown
Contributor Author

bouk commented Sep 1, 2015

@graingert how's this look?

Comment thread redshift_sqlalchemy/compat.py Outdated
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.

I prefer parenthesis with my tuples

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 move the noqa to this line?

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.

Me too, I just copied the sa style. fixed

@graingert
Copy link
Copy Markdown
Member

Looks good to me, have a look at the fixes then update the issue name, changelog, squash etc

@bouk bouk changed the title Use sqlalchemy.util.string_types to check if it's a string Use a compatibility layer to check string types Sep 1, 2015
@bouk bouk changed the title Use a compatibility layer to check string types Fix unicode with SORTKEY on python 2 Sep 1, 2015
@bouk bouk changed the title Fix unicode with SORTKEY on python 2 Fix unicode issue with SORTKEY on python 2 Sep 1, 2015
@bouk
Copy link
Copy Markdown
Contributor Author

bouk commented Sep 1, 2015

done

graingert added a commit that referenced this pull request Sep 1, 2015
Fix unicode issue with SORTKEY on python 2
@graingert graingert merged commit be53c70 into sqlalchemy-redshift:master Sep 1, 2015
@bouk bouk deleted the check-unicode branch September 1, 2015 21:08
haleemur pushed a commit to haleemur/redshift_sqlalchemy that referenced this pull request Sep 2, 2015
Fix unicode issue with SORTKEY on python 2
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