hacky pass at uuid sorting #218

Merged
merged 3 commits into from Feb 4, 2014

Conversation

Projects
None yet
2 participants
@kurtjx
Contributor

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

This comment has been minimized.

Show comment Hide comment
@thobbs

thobbs Jan 10, 2014

Owner

Why not just do:

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

when the comparator is TimeUUID?

Owner

thobbs commented Jan 10, 2014

Why not just do:

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

when the comparator is TimeUUID?

@kurtjx

This comment has been minimized.

Show comment Hide comment
@kurtjx

kurtjx Jan 10, 2014

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment Hide comment
@thobbs

thobbs Jan 10, 2014

Owner

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?

Owner

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

This comment has been minimized.

Show comment Hide comment
@kurtjx

kurtjx Feb 4, 2014

Contributor

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).

Contributor

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

Merge pull request #218 from kurtjx/master
hacky pass at uuid sorting

@thobbs thobbs merged commit 7fbb698 into pycassa:master Feb 4, 2014

1 check passed

default The Travis CI build passed
Details
@thobbs

This comment has been minimized.

Show comment Hide comment
@thobbs

thobbs Feb 4, 2014

Owner

Thanks! I think that looks pretty good.

Owner

thobbs commented Feb 4, 2014

Thanks! I think that looks pretty good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment