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 driver - get_field is not implemented #1941

Closed
neumino opened this issue Feb 10, 2014 · 4 comments
Closed

Python driver - get_field is not implemented #1941

neumino opened this issue Feb 10, 2014 · 4 comments
Assignees
Milestone

Comments

@neumino
Copy link
Member

neumino commented Feb 10, 2014

We need get_field in some cases like #1434

cursor = r.db('cakemeter').table('stars') \
    .filter({"repo": "rethinkdb"}) \
    .get_field("stars") \
    .run()

Throws

AttributeError: 'Filter' object has no attribute 'get_field'

Users can use __getitem__ though.

@neumino neumino added this to the subsequent milestone Feb 10, 2014
@mlucy mlucy modified the milestones: 1.11.x, subsequent Feb 10, 2014
@mlucy
Copy link
Member

mlucy commented Feb 10, 2014

This seems like a bug to me: you sometimes need to use get_field rather than [] (e.g. if writing r('foo').do(lambda x: obj.get_field(x))).

Moving to 1.11.x and assigning to @Tryneus .

@Tryneus
Copy link
Member

Tryneus commented Feb 11, 2014

Fix up in review 1196. It also occurs to me the the python driver does not preserve the 'get_field' call in backtraces, and replaces it with brackets instead, which would result in an erroneous query in the example @mlucy gave, so I'll work on that as well.

@Tryneus
Copy link
Member

Tryneus commented Feb 11, 2014

The fix for the backtraces is up in review 1198.

@Tryneus
Copy link
Member

Tryneus commented Feb 12, 2014

This has been approved and merged into next in commits ac9b7fc and 2a5bbe3. The get_field change has been cherry-picked into v1.11.x in commit 8062708, but the backtrace fix had a merge conflict so I haven't cherry-picked it.

@Tryneus Tryneus closed this as completed Feb 12, 2014
@AtnNn AtnNn modified the milestones: 1.12, 1.11.x Mar 24, 2014
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

No branches or pull requests

4 participants