airbyte-source-shopify 3.2.0__py3-none-any.whl → 3.2.0.dev202602040050__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: airbyte-source-shopify
3
- Version: 3.2.0
3
+ Version: 3.2.0.dev202602040050
4
4
  Summary: Source CDK implementation for Shopify.
5
5
  Home-page: https://airbyte.com
6
6
  License: ELv2
@@ -44,7 +44,7 @@ source_shopify/schemas/orders.json,sha256=SxX6fDtMnEkvm-58uNgaoF47Ep8DIwLpXK09C2
44
44
  source_shopify/schemas/pages.json,sha256=J7jxtk2nE_q-0oHmGz8orFq3EfSjJqUvF6qPJtiZCrg,2093
45
45
  source_shopify/schemas/price_rules.json,sha256=aZ-Re9Oc9g0ci8SPn0_ufvKPsGDBcTaXHVsq_9-Ygq4,7004
46
46
  source_shopify/schemas/product_images.json,sha256=0l3ACfOfnXz8N8oMHwvvfZUFKeeuZ2DlRRu5-FxUhaI,1760
47
- source_shopify/schemas/product_variants.json,sha256=hBtmB-OyVlmkQacY0s7Mpe-bMdYjx8mpwMqcGwN05kA,8121
47
+ source_shopify/schemas/product_variants.json,sha256=TipJMwLLBi9ULVxCEya14W-de7Fr4qfLAfCPETTtdeM,8412
48
48
  source_shopify/schemas/products.json,sha256=n7m1ndEnAM7Pee5ca0JZWCl5Y0VffGmTZjqjHhiht1I,22609
49
49
  source_shopify/schemas/profile_location_groups.json,sha256=2_QdfMeM_WNDT-06fQfFUHXjN9D6ndKIGcviJxEl8kM,189
50
50
  source_shopify/schemas/shop.json,sha256=vEGiTvEYX7qnMq06MRVBycqih49h49xjTNC6gJuxTWs,8137
@@ -55,7 +55,7 @@ source_shopify/scopes.py,sha256=R6f7t211n_nrh0T897u72ODo_hI6mzPC1NbN0vq-upI,6579
55
55
  source_shopify/shopify_graphql/bulk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  source_shopify/shopify_graphql/bulk/exceptions.py,sha256=4dj7Za4xIfwL-zf8joT9svF_RSoGlE3GviMiIl1e1rs,2532
57
57
  source_shopify/shopify_graphql/bulk/job.py,sha256=c3Cg70_Io9jTD-rU-5MvjHaPmJCtcpeqEYnRtFECGOo,28673
58
- source_shopify/shopify_graphql/bulk/query.py,sha256=GlwUwZoDkHyUYzfEr7RhVENhS2aMta6OMPYod2wcQbA,134819
58
+ source_shopify/shopify_graphql/bulk/query.py,sha256=A8-VJGxzJnkkVZm62TAw6OZlWcIs9VHzhO-rMaVHc0E,136522
59
59
  source_shopify/shopify_graphql/bulk/record.py,sha256=X6VGngugv7a_S8UEeDo121BkdCVLj5nWlHK76A21kyo,16898
60
60
  source_shopify/shopify_graphql/bulk/retry.py,sha256=R5rSJJE8D5zcj6mN-OmmNO2aFZEIdjAlWclDDVW5KPI,2626
61
61
  source_shopify/shopify_graphql/bulk/status.py,sha256=RmuQ2XsYL3iRCpVGxea9F1wXGmbwasDCSXjaTyL4LMA,328
@@ -66,7 +66,7 @@ source_shopify/streams/base_streams.py,sha256=k_4uLaLADLRTUcSmP8uA_830uuzRvnqUaC
66
66
  source_shopify/streams/streams.py,sha256=I68Li0EPR9acj3Jhk7qd-zWhESkPHRzLA_b-LmbTjsE,20044
67
67
  source_shopify/transform.py,sha256=mn0htL812_90zc_YszGQa0hHcIZQpYYdmk8IqpZm5TI,4685
68
68
  source_shopify/utils.py,sha256=DSqEchu-MQJ7zust7CNfqOkGIv9OSR-5UUsuD-bsDa8,16224
69
- airbyte_source_shopify-3.2.0.dist-info/METADATA,sha256=_hASusIiIv3XMGAUhHCfT_7HDZvoxnregmL6vPadIuc,5297
70
- airbyte_source_shopify-3.2.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
71
- airbyte_source_shopify-3.2.0.dist-info/entry_points.txt,sha256=SyTwKSsPk9MCdPf01saWpnp8hcmZOgBssVcSIvMbBeQ,57
72
- airbyte_source_shopify-3.2.0.dist-info/RECORD,,
69
+ airbyte_source_shopify-3.2.0.dev202602040050.dist-info/METADATA,sha256=eo4mrM9Mova_yKHxI5QkOs2O4bZuqjoMt49z-vbkNFI,5313
70
+ airbyte_source_shopify-3.2.0.dev202602040050.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
71
+ airbyte_source_shopify-3.2.0.dev202602040050.dist-info/entry_points.txt,sha256=SyTwKSsPk9MCdPf01saWpnp8hcmZOgBssVcSIvMbBeQ,57
72
+ airbyte_source_shopify-3.2.0.dev202602040050.dist-info/RECORD,,
@@ -52,12 +52,20 @@
52
52
  "items": {
53
53
  "type": ["null", "object"],
54
54
  "properties": {
55
+ "id": {
56
+ "description": "The unique identifier for the product option.",
57
+ "type": ["null", "integer"]
58
+ },
55
59
  "name": {
56
- "description": "The product options name.",
60
+ "description": "The product option's name.",
57
61
  "type": ["null", "string"]
58
62
  },
63
+ "position": {
64
+ "description": "The display order of the product option.",
65
+ "type": ["null", "integer"]
66
+ },
59
67
  "value": {
60
- "description": "The product options value.",
68
+ "description": "The product option's value.",
61
69
  "type": ["null", "string"]
62
70
  },
63
71
  "option_value": {
@@ -2791,7 +2791,13 @@ class ProductVariant(ShopifyBulkQuery):
2791
2791
  Field(name="selectedOptions", alias="options", fields=option_fields),
2792
2792
  Field(name="image", fields=image_fields),
2793
2793
  Field(name="inventoryQuantity", alias="old_inventory_quantity"),
2794
- Field(name="product", fields=[Field(name="id", alias="product_id")]),
2794
+ Field(
2795
+ name="product",
2796
+ fields=[
2797
+ Field(name="id", alias="product_id"),
2798
+ Field(name="options", alias="product_options", fields=["id", "name", "position"]),
2799
+ ],
2800
+ ),
2795
2801
  Field(name="inventoryItem", fields=inventory_item_fields),
2796
2802
  ] + presentment_prices
2797
2803
 
@@ -2838,6 +2844,34 @@ class ProductVariant(ShopifyBulkQuery):
2838
2844
  entity = record.get(from_property, {})
2839
2845
  return self.tools.resolve_str_id(entity.get(id_field)) if entity else None
2840
2846
 
2847
+ def _enrich_options_with_product_options(self, record: MutableMapping[str, Any]) -> None:
2848
+ """
2849
+ Enriches the variant's options with id and position from the product's options.
2850
+ Matches options by name and adds the corresponding ProductOption id and position.
2851
+ """
2852
+ options = record.get("options") or []
2853
+ product = record.get("product") or {}
2854
+ product_options = product.get("product_options") or []
2855
+
2856
+ # Build a lookup map from option name to ProductOption data
2857
+ product_options_map = {}
2858
+ for product_option in product_options:
2859
+ if product_option:
2860
+ name = product_option.get("name")
2861
+ if name:
2862
+ product_options_map[name] = {
2863
+ "id": self.tools.resolve_str_id(product_option.get("id")),
2864
+ "position": product_option.get("position"),
2865
+ }
2866
+
2867
+ # Enrich each option with id and position from the matching ProductOption
2868
+ for option in options:
2869
+ if option:
2870
+ option_name = option.get("name")
2871
+ if option_name and option_name in product_options_map:
2872
+ option["id"] = product_options_map[option_name]["id"]
2873
+ option["position"] = product_options_map[option_name]["position"]
2874
+
2841
2875
  def record_process_components(self, record: MutableMapping[str, Any]) -> Iterable[MutableMapping[str, Any]]:
2842
2876
  """
2843
2877
  Defines how to process collected components.
@@ -2850,6 +2884,9 @@ class ProductVariant(ShopifyBulkQuery):
2850
2884
  record["presentment_prices"] = self._process_presentment_prices(record_components.get("ProductVariantPricePair", []))
2851
2885
  record.pop("record_components")
2852
2886
 
2887
+ # enrich options with id and position from product options (must be done before product is removed)
2888
+ self._enrich_options_with_product_options(record)
2889
+
2853
2890
  # unnest mandatory fields from their placeholders
2854
2891
  record["product_id"] = self._unnest_and_resolve_id(record, "product", "product_id")
2855
2892
  record["inventory_item_id"] = self._unnest_and_resolve_id(record, "inventoryItem", "inventory_item_id")