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

AttributeError: 'list' object has no attribute 'next_url' #238

Closed
Ndz85 opened this issue Oct 24, 2022 · 2 comments
Closed

AttributeError: 'list' object has no attribute 'next_url' #238

Ndz85 opened this issue Oct 24, 2022 · 2 comments
Labels
V3 OData V3

Comments

@Ndz85
Copy link

Ndz85 commented Oct 24, 2022

I get this error when following the next_url code. V3

jobs = service.entity_sets.Jobs.get_entities().select('Location').execute()
while True:
    for job in jobs:
     print(job.Location)

    
    # Stop if server has no more entities left
    if jobs.next_url is None:
        break
    
    
    # We got a partial answer - continue with next page
    jobs = service.entity_sets.Jobs.get_entities().next_url(jobs.next_url).execute()
@phanak-sap phanak-sap added the V3 OData V3 label Oct 26, 2022
@phanak-sap
Copy link
Contributor

phanak-sap commented Oct 26, 2022

V3 is the problem, pyodata at the moment supports only V2 odata protocol. Lots of things are backward compatible with V2, but some incompatible changes are there.

Out of curiosity, could you paste the $metadata for the service and the json response for the:
service.entity_sets.Jobs.get_entities().select('Location').execute()

Or you may directly provide failing test - check this one as a base:

def test_partial_listing(service):

Just providing the code that creates the error is not something that I can reproduce locally.

Since it got through the initial metadata parsing, I would like to check if you by accident uncover bug that would be present in odata V2 service as well.

Just glancing over V3 spec, the __next field should be in the JSON response similarly to V2 version - https://www.odata.org/documentation/odata-version-3-0/json-verbose-format/.

@phanak-sap
Copy link
Contributor

Hi @Ndz85 I am closing this issue due impossibility to reproduce and inactivity from your side. If you return to this with code that reproduces the problem, please reopen.

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

No branches or pull requests

2 participants