Skip to content
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

PYTHON-609: Align Text and Ascii columns behaviour #623

Merged
merged 9 commits into from Jul 27, 2016
Merged

PYTHON-609: Align Text and Ascii columns behaviour #623

merged 9 commits into from Jul 27, 2016

Conversation

kdeldycke
Copy link
Contributor

@kdeldycke kdeldycke commented Jul 18, 2016

This PR:

  • Add full unit-tests of CQLengine's Ascii columns.
  • Extend Text columns unit-tests for minimal and maximal length.
  • Thoroughly cover edge-cases on empty / blank / None value strings handling, especially in relation to the required column parameter.
  • Align Ascii column behaviour to Text, by adding min_length and max_length parameter support.

@kdeldycke
Copy link
Contributor Author

Ah. Just realized that there's two sets of tests: unit and integration. Unfortunately the later are not launched by Travis. Is this expected?

@GregBestland
Copy link
Contributor

Unfortunately our integration tests are a little too hefty to run on travis. We have some separate internal infrastructure to run these. It is expected.

@kdeldycke kdeldycke changed the title Extend Text and Ascii columns tests [CQLengine] Align Text and Ascii columns behaviour Jul 20, 2016
@kdeldycke
Copy link
Contributor Author

Both unit and integration tests pass on my machine.

This PR is ready to be reviewed and merged.

@kdeldycke
Copy link
Contributor Author

As a side note, this covers old cqlengine/cqlengine#283 PR

@kdeldycke kdeldycke mentioned this pull request Jul 20, 2016
@GregBestland
Copy link
Contributor

GregBestland commented Jul 20, 2016

We will use this PR, instead of mine. I like the way you handled the validation better.

For reference the jira number covering this in our project is
https://datastax-oss.atlassian.net/browse/PYTHON-609

@kdeldycke
Copy link
Contributor Author

OK, as you wish. Do not hesitate to tell me of this PR needs some changes or improvements.

For instance, do you want me to separate the string handling logic in its own class? Like you did with the BaseStringColumn class?

raise ValidationError('{0} is shorter than {1} characters'.format(self.column_name, self.min_length))
return value


class Ascii(Text):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

We either need a separate class extending the init and validation logic, or Text needs to extend Ascii, either way is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I was thinking the other way around is that I'm about to add a validation() in Ascii to extend on Text's, and add stricter checks on legal ASCII character range. Do you want me to implement this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just added the extra validation on ASCII characters in commit 1a72f87 .

@GregBestland
Copy link
Contributor

We were also wondering what the priority level of this change is for you? Is it blocking a critical path for you?

@kdeldycke
Copy link
Contributor Author

This is not highly critical. But once this PR is merged upstream I'll be able to delete some hard-coded checks in my proprietary code, to rely exclusively on CQLengine! 😅

@kdeldycke
Copy link
Contributor Author

I addressed all comments on this PR. If you have nothing to add, this is ready for a merge.

@kdeldycke kdeldycke changed the title [CQLengine] Align Text and Ascii columns behaviour PYTHON-609: Align Text and Ascii columns behaviour Jul 22, 2016
@GregBestland GregBestland merged commit d956b2e into datastax:master Jul 27, 2016
@GregBestland
Copy link
Contributor

Thank you so much for your patience and assistance. Sorry it took me so long to get back to you.

This will be included in our next release. 👍

@kdeldycke kdeldycke deleted the align-text-ascii-columns-tests branch July 27, 2016 20:53
@kdeldycke
Copy link
Contributor Author

Thanks @GregBestland for the merge! Really happy to contribute! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants