Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

hacky pass at uuid sorting #218

Merged
merged 3 commits into from Feb 4, 2014
Merged

hacky pass at uuid sorting #218

merged 3 commits into from Feb 4, 2014

Conversation

kurtjx
Copy link
Contributor

@kurtjx kurtjx commented Oct 18, 2013

An attempt at addressing #217

This seems to work but I'm not all-together in love with it. One major deal breaker issue, if you expect your column names to actually be DateTypes rather than time uuids, you will get time uuids back and be massively confused. I'm not sure how to address that without making the stubs fully aware of the column family definition.

So this is really not a pull request, but an ask for better ideas I guess. Thanks.

@thobbs
Copy link
Member

thobbs commented Jan 10, 2014

Why not just do:

items = sorted(items, key=lambda uuid: uuid.time)

when the comparator is TimeUUID?

@kurtjx
Copy link
Contributor Author

kurtjx commented Jan 10, 2014

I didn't know you can do that with uuid objects - that is better. However, I don't think the mock cassa will even know what the comparator type is in the current implementation. We could check the type() on items i guess but still seems pretty hacky.

@thobbs
Copy link
Member

thobbs commented Jan 10, 2014

I'm okay with it being somewhat hacky just for stubs purposes. How about checking to see if the first column is an instance of UUID and has a version attribute with value 1?

@kurtjx
Copy link
Contributor Author

kurtjx commented Feb 4, 2014

Sorry for the slow turn-around. I think this is what we want more or less. Embarrassingly I'm having a hard time getting the tests to run on my dev box (actually getting a local cassandra to run).

thobbs added a commit that referenced this pull request Feb 4, 2014
hacky pass at uuid sorting
@thobbs thobbs merged commit 7fbb698 into pycassa:master Feb 4, 2014
@thobbs
Copy link
Member

thobbs commented Feb 4, 2014

Thanks! I think that looks pretty good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants