GithubHelp home page GithubHelp logo

Comments (17)

ryanking avatar ryanking commented on June 16, 2024

I'm not opposed to this, but since its not a priority for us, all I can contribute is design help/review. If you'd like to tackle it I can help sort out a design.

from cassandra.

mperham avatar mperham commented on June 16, 2024

If you want to give me commit access, I'd be happy to work on an API + tests with your suggestions.

from cassandra.

ryanking avatar ryanking commented on June 16, 2024

I'd prefer to use github's fork and pull model for development.

from cassandra.

IcyMidnight avatar IcyMidnight commented on June 16, 2024

Based on the commit log and this issue being open, it doesn't seem this has been added. Are you still planning to look into this Mike? If not perhaps I can make an attempt myself.

from cassandra.

mperham avatar mperham commented on June 16, 2024

I spent an hour or two on it but it was a fairly large API change and I doubt I will have time to on it more. Feel free to work on it.

from cassandra.

siggy avatar siggy commented on June 16, 2024

Pull request sent for:
http://github.com/siggy/cassandra/commit/439ce611a1c6d15574b47780bd34d174b124dc9b

API backwards compatibility is preserved. However, enabling the new 'timestamp' option will alter the data structure returned.

>> twitter.get(:Statuses, "1")
=> #<OrderedHash {"text"=>"Nom nom nom nom nom.", "user_id"=>"5"}>
>> twitter.get(:Statuses, "1", :timestamp => true)
=> #<OrderedHash {"text"=>{"timestamp"=>1273096932561890, "value"=>"Nom nom nom nom nom."}, "user_id"=>{"timestamp"=>1273096932561890, "value"=>"5"}}>

Comments/suggestions?

from cassandra.

mperham avatar mperham commented on June 16, 2024

Nice!

Only thing I can think of would be an option to convert those timestamps to actual Ruby objects, rather than just raw integers. I guess if all you want to do is compare timestamps, it's not necessary.

from cassandra.

ryanking avatar ryanking commented on June 16, 2024

@mperham -

I assume you're talking about converting the timestamps to Time objects...

In cassandra, "timestamp" means "long that represents something like time" and not everyone uses it the same way, so I say we should just expose it as an int.

from cassandra.

evan avatar evan commented on June 16, 2024

It is probably okay to consistently cast Timestamps in our client. People who use multiple clients will probably know what they're doing.

If you're going to use the deep hash response API, timestamp and value should be symbols.

Would it make sense to subclass String for the column names, and decorate it with an additional timestamp accessor? That way backwards compatibility could be preserved. Or maybe an explicit column struct would be better.

from cassandra.

ryanking avatar ryanking commented on June 16, 2024

Maybe we should extend OrderdHash with at timestamps method, so that you can do

twitter.get(:Statuses, "1").timestamps[:text] =>1273096932561890

from cassandra.

mrflip avatar mrflip commented on June 16, 2024

+1 to extending OrderedHash with a timestamps method rather than using the nested hash.

from cassandra.

tomafro avatar tomafro commented on June 16, 2024

+1 from me also. If this isn't being worked on by anyone, I am happy to give it a go over the next fortnight

from cassandra.

ryanking avatar ryanking commented on June 16, 2024

Looks like this is dead?

from cassandra.

mperham avatar mperham commented on June 16, 2024

I no longer need this functionality. I'll defer to others.

from cassandra.

tomafro avatar tomafro commented on June 16, 2024

Yeah, sorry. I looked in to adding it (seemed pretty easy), but quickly realised I had no real need for it.

from cassandra.

siggy avatar siggy commented on June 16, 2024

Pull request sent for:
http://github.com/siggy/cassandra/commit/87276cf3c44e89a1e1a5d3d8c3d064da85f2db47

OrderedHash::timestamps is itself a hash (unordered for RUBY_VERSION < 1.9):

>> twitter.get(:Statuses, "1").timestamps
=> {"text"=>1282724889876849, "user_id"=>1282724889876849} 

>> twitter.get(:Statuses, "2").timestamps
=> {"reply_to_id"=>1282724889881382, "text"=>1282724889881382, "user_id"=>1282724889881382}

from cassandra.

ryanking avatar ryanking commented on June 16, 2024

merged siggy's work. boom!

from cassandra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.