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

Do not require keys to be strings in the python driver #2121

Open
AtnNn opened this issue Mar 20, 2014 · 5 comments
Open

Do not require keys to be strings in the python driver #2121

AtnNn opened this issue Mar 20, 2014 · 5 comments

Comments

@AtnNn
Copy link
Member

AtnNn commented Mar 20, 2014

This is the current behaviour:

>>> r.expr({r.expr("a"): 1})
rethinkdb.errors.RqlDriverError: Object keys must be strings.
>>> r.object(r.expr("a"), 1).run()
{u'a': 1}

I propose allowing this:

>>> r.expr({r.expr("a"): 1}).run()
{u'a': 1}

Care must be taken when implementing this because OBJECT is not a drop-in replacement for MAKE_OBJ (e.g. #2120)

@coffeemug coffeemug added this to the backlog milestone Mar 20, 2014
@coffeemug
Copy link
Contributor

Is there a specific use case for it, or is it just general cleanup? (It would make a difference for scheduling)

@AtnNn
Copy link
Member Author

AtnNn commented Mar 20, 2014

This would just be a nice shortcut for object.

@mlucy
Copy link
Member

mlucy commented Mar 20, 2014

If we do this, we should do it in all the drivers. (Also, tagging as REQL_PROPOSAL instead of reql because it isn't 100% obvious to me we should do it. It would involve making the output of r.expr("a") hashable, for example.)

@srh
Copy link
Contributor

srh commented Mar 21, 2014

We can't do it in all the drivers.

@mlucy
Copy link
Member

mlucy commented Mar 21, 2014

No, but we can do it in Ruby.

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

No branches or pull requests

5 participants