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

Fix support for setting "bytes" as datatype #242

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

koenlek
Copy link

@koenlek koenlek commented Dec 17, 2020

This fixes #230. This fix enables using 'bytes' type like this:

datashape.dshape('{foo: bytes}')

To verify this fix, you can run:

conda create -y -n datashape_test python=2.7 
conda activate datashape_test
conda install -y --file requirements.txt
python -c "import datashape; my_shape = datashape.dshape('{foo: bytes}'); print(my_shape)" # WORKS!
git checkout HEAD^
python -c "import datashape; my_shape = datashape.dshape('{foo: bytes}'); print(my_shape)" # fails...
git checkout fix_bytes_support
conda deactivate

# To try with another py version, just:
conda env remove -n datashape_test
conda create -y -n datashape_test python=3.7
# Then repeat the steps from above starting from the "conda install ..." line

In practice I tested a datashape with "bytes" to help me serialize and deserialize bytes data and it worked perfectly.

Note that I suspect the CI failures to be false failures. Locally all tests succeed on the py versions I tested (2.7 and 3.7). For example, this PR has the same failures: https://travis-ci.org/github/blaze/datashape/builds/705165599

@koenlek
Copy link
Author

koenlek commented Dec 17, 2020

@llllllllll , @kglowinski, @skrah , you seem among the last to merge PRs to this repo. How about merging this PR, bumping version to 0.5.5, tag it, and releasing it to pypi (the last version on pypi is 0.5.2, though the last tag here is 0.5.4)?

If you're willing to support releasing it, then I might put in the time for another small fix: improving DataShapeSyntaxError to be more meaningful by printing what field it errored on, like requested here: #181

I had a look at the code and it looks like a simple improvement.

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.

bytes type not complete
1 participant