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

Variant data missing 'product_id' attribute when using pagination #736

Open
1 task done
dom-dynamicos opened this issue Sep 12, 2024 · 0 comments
Open
1 task done

Comments

@dom-dynamicos
Copy link

Issue summary

When retrieving all Variant records using pagination, the 'product_id' attribute is only returned for the first page of variants.

Expected behavior

I'm expecting 'product_id' to be present when calling 'shopify.Variant.find()' as well as after '.has_next_page()' has been called.

Actual behavior

Calling 'has_next_page()' seems to exclude 'product_id'. If attempting to access 'product_id' after 'has_next_page()' has been called, the following error is returned:
'File "[...]\Python\Python311\Lib\site-packages\pyactiveresource\activeresource.py", line ###, in getattr
raise AttributeError(name)
AttributeError: product_id'

Steps to reproduce the problem

  1. variants = shopify.Variant.find()
  2. for variant in variants:
    print(variant.product_id)
  3. while variants.has_next_page():
    variants = variants.next_page()
    Run the same code as 2 again

Checklist

  • I have described this issue in a way that is actionable (if possible)
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

1 participant