Giter Site home page Giter Site logo

Comments (9)

runemy avatar runemy commented on July 18, 2024 2

Minimal test case:

a = dict()
a.keys()[0]

Replace with:

a = dict()
next(iter(a))

from azure-cosmos-python.

rnagpal avatar rnagpal commented on July 18, 2024

@khdang Can you look into this please? This seems to be related to aggregate query support.

from azure-cosmos-python.

l-Leniac-l avatar l-Leniac-l commented on July 18, 2024

Same problem here:

client.QueryDocuments(coll['_self'], {
    'query': 'SELECT VALUE COUNT(c.id) FROM c'
})

results in:

File "/home/lenilson/anaconda3/envs/orcamentos/lib/python3.6/site-packages/pydocumentdb/execution_context/endpoint_component.py", line 98, in next
    operator.aggregate(item[item.keys()[0]])
TypeError: 'dict_keys' object does not support indexing

from azure-cosmos-python.

khdang avatar khdang commented on July 18, 2024

@runemy thanks for catching this, and the suggestion. I'll fix it shortly. In the meantime, feel free to send a PR and we'll be happy to merge it.

from azure-cosmos-python.

khdang avatar khdang commented on July 18, 2024

@lnlwd thanks for reporting

from azure-cosmos-python.

runemy avatar runemy commented on July 18, 2024

Thanks @khdang :) Would be nice if you can fix this and verify that an aggregated query works.

from azure-cosmos-python.

l-Leniac-l avatar l-Leniac-l commented on July 18, 2024

Can you guys review my PR? It's working with @runemy and my queries.

from azure-cosmos-python.

rnagpal avatar rnagpal commented on July 18, 2024

@khdang: Please review and merge.

from azure-cosmos-python.

runemy avatar runemy commented on July 18, 2024

Any progress on this?

from azure-cosmos-python.

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.