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

🎉 Source Shopify: update the Shopify api version to 2024-04 #38610

Conversation

bazarnov
Copy link
Collaborator

@bazarnov bazarnov commented May 23, 2024

What

Resolving:

How

  • Fixed the Inventory_levels stream schema, by adding new quantities property, instead of availabile (it's deprecated for 2024-04)
  • Fixed the Collections stream BULK query to guarantee having products_count with the new 2024-04
  • Pinned the Products_graph_ql stream to use the 2023-07 API version to ensure it works as expected before we deprecate it.
  • Updated expected records, since we have added new fields
  • Updated the unit tests/graphql_bulk/: test_query.py and test_job.py to cover the changes.

User Impact

  • No impact is expected, this is not a breaking change.
  • Customers who want to have the updated fields should be able to Refresh Schema > Apply changes, with no reset.

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented May 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 23, 2024 0:53am

@octavia-squidington-iii octavia-squidington-iii added the area/connectors Connector related issues label May 23, 2024
@bazarnov bazarnov marked this pull request as ready for review May 23, 2024 12:49
@bazarnov bazarnov requested a review from a team May 23, 2024 12:49
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label May 23, 2024
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of questions to make sure I understand. I'll recheck real quick once I have the information


return Query(
name="quantities",
arguments=[Argument(name="names", value=self.quantities_names_filter)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this argument? Can't we just get everything? Could we have dataloss if a new quantity.name is added?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we can't. This is the part of the nested query building process, let's keep this simple.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by get just everything?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding by the name of it is that this is a filter meaning that we fetch only the values that are defined in self.quantities_names_filter. So effectively, this generate this part of the query:

    quantities(names: <list represented by self.quantities_names_filter>) {
      <fields>
    }

Can we just query for everything by not passing this filter like this?

    quantities {
      <fields>
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got your point, we fetch all the values available, there is no wildcard fetch for this, by non-specifying these types. We have to pass all of them as it is now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is some more info:

"errors": [
    {
      "message": "names has an invalid value. Possible values include: available, committed, damaged, incoming, 
    on_hand, quality_control, reserved, safety_stock.",
   ...
   }
]

There is no opportunity to pass * or ALL, or something else.

The official doc is here: https://shopify.dev/docs/apps/fulfillment/inventory-management-apps#inventory-states

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the reference link to the code, for quick tips about that, as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other possibility I see is an integration tests that query for a value we know does not exist and ensure the error message contains only the possible values we know of. Is this something you think is worth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've decided for now that this isn't worth the hassle of creating a test that query for an error to validate the names. However, we will contact Shopify support to ask them if they can accept a wildcard on it and see how they react

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an Issue for the Shopify Comunity with the question and improvement suggestion: https://community.shopify.com/c/graphql-basics-and/graphql-inventorylevels-quantities-issue-with-names-state-filter/m-p/2587605#M13215

@bazarnov bazarnov requested a review from maxi297 May 23, 2024 17:44
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the comments!

@bazarnov
Copy link
Collaborator Author

The Shopify community issue about the mandatory names filter improvement / questions around that: https://community.shopify.com/c/graphql-basics-and/graphql-inventorylevels-quantities-issue-with-names-state-filter/m-p/2587605#M13215

@bazarnov bazarnov merged commit b68704f into master May 24, 2024
51 checks passed
@bazarnov bazarnov deleted the baz/baz/source/shopify/fix-streams-regressions-after-swith-to-2024-04 branch May 24, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/shopify team/critical-connectors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants