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

Missing attributes when paginating customers #677

Closed
askl-addepto opened this issue Aug 14, 2023 · 4 comments
Closed

Missing attributes when paginating customers #677

askl-addepto opened this issue Aug 14, 2023 · 4 comments
Labels

Comments

@askl-addepto
Copy link

Issue summary

When executing function Customers.find() only the first page contains user emails, any customer retrieved from .next_page() is missing important attributes.

Expected behavior

I would expect every customer in all pages contain the same attributes.

Actual behavior

Only the customers on the first page have key attributes like first_name, last_name and email.

Steps to reproduce the problem

  1. Execute function Customer.find() on a set of customers larger than the limit.
  2. On the result object execute .next_page().
  3. Print any customer from the result.
@ScottRoach
Copy link

ScottRoach commented Aug 14, 2023

What API version are you using and could you provide some code?

The only difference that I see in the 2023-04 version is the lack of default_address in the first page.

# Get first 2 pages of customers
customers_page1 = shopify.Customer.find(limit=10)
customers_page2 = customers_page1.next_page()

# Get the unique keys for the first customer in those pages
page1_keys = set(customers_page1[0].attributes.keys())
page2_keys = set(customers_page2[0].attributes.keys())

# Show the differences between the 2 sets of keys
print('Page 1 keys not in page 2:', page1_keys.difference(page2_keys))
print('Page 2 keys not in page 1:', page2_keys.difference(page1_keys))

# Results:
# Page 1 keys not in page2: set()
# Page 2 keys not in page 1: {'default_address'}

@ScottRoach
Copy link

If you are specifying fields make sure you set them as a string and not an array, because that will exhibit the behavior that you mentioned. Ex:

customers = shopify.Customer.find(fields=['id', 'email']) # Incorrect
customers = shopify.Customer.find(fields='id,email') # Correct

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

@github-actions github-actions bot added the Stale label Oct 15, 2023
@github-actions
Copy link

We are closing this issue because it has been inactive for a few months.
This probably means that it is not reproducible or it has been fixed in a newer version.
If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants