← back to Kravet Sheet Sync 2026 04 20

__pycache__/test_push_metafields_only.cpython-314.pyc

77 lines

+
x
Yj�	���Rt^RIt^RIt^RItRt]PPRR4t	Rt
R]R]
R2tR	R
RR/R	R
RR/.tR!Rlt
RtRtRtRtRt]EFt]!]R	,4t]'g]!R]R	,R24K0]!]]R,4t]!R]R	,R]!]4R24^t.t]!^]!]4^4Fxt]]]^,t]
!]R]/4t]R,R,;'g.t]R,R,;'g.t]]!]4,
t]'gKg]PA]4Kz	]!R]R]!]424]'gEK]!R]R ,24EK 	R#)"zTChunked metafields retry for the 2 products already created by test_push_2_items.py.Nz)designer-laboratory-sandbox.myshopify.com�SHOPIFY_ADMIN_TOKEN�z2024-10zhttps://z/admin/api/z
/graphql.json�dw_skuzDWKK-141031�pidz#gid://shopify/Product/7821427441715zDWKK-141042z#gid://shopify/Product/7821427474483c	���\P!RTRT;'g//4P4p\PP\VRRRR\/R7p\PPV^R7;_uu_4p\P!VP44pRRR4R	X9d\R
VR	,24hVR,# +'giL5;i)�query�	variables�POSTzContent-Typezapplication/jsonzX-Shopify-Access-Token)�data�method�headers)�timeoutN�errorszGraphQL errors: r
)�json�dumps�encode�urllib�request�Request�GQL_URL�TOKEN�urlopen�loads�read�RuntimeError)rr�body�req�rr
s&&    �9kravet-sheet-sync-2026-04-20/test_push_metafields_only.py�gqlrs����:�:�w��{�I�O�O��D�E�L�L�N�D�
�.�.�
 �
 ��t�F��!3�5M�u�U�!�W�C�	���	�	��R�	�	0�	0�A��z�z�!�&�&�(�#��
1��4���-�d�8�n�-=�>�?�?���<��	
1�	0�s�%C�C-	c���\P!RRRVR2.RRRR7pVPP4P	R4Uu.uFq"'gKVP	R4NK	up#uupi)�sshzroot@45.61.58.125zNPGPASSWORD=DW2024! psql -h 127.0.0.1 -U dw_admin -d dw_unified -At -F "|" -c "�"T)�capture_output�text�check�
�|)�
subprocess�run�stdout�strip�split)�qr�lines&  r�pg_rowsr/so������1�
X�YZ�X[�[\�]�_��$�d�	4�A�)*�����(8�(>�(>�t�(D�M�(D���O�D�J�J�s�O�(D�M�M��Ms�
	A3�A3c��a�V'gV#0RmoVP4P4P4pRPV3Rl\	V444#)�a� c3�<"�TFFwrV^8�d
VS9dTM.V'd&V^,P4VR,,MTx�KH	R#5i)�:�NNN)�upper)�.0�i�w�smalls&  �r�	<genexpr>�title_case.<locals>.<genexpr>'sB����1�/����1���e��A��!�A�$�*�*�,�q��u�2D�q�Q�/�s
�A�/A>
r1�an�at�in�of�on�or�to�and�but�for�the�with)r+�lowerr,�join�	enumerate)�s�wordsr:s& @r�
title_caserN#sM����Q�h�S�E�
�G�G�I�O�O��#�#�%�E��8�8�1�(��/�1�1�1�c��RVR2p.RNRNRNRNRNRNRNR	NR
NRNRNR
NRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNRNR NR!NR"NR#NR$NR%NR&NR'NR(NR)NR*Np\V4pV'd\\W#^,44#R+#),a�
    SELECT n.mfr_sku, n.pattern_name, n.color_name, n.brand, n.collection,
           n.country_of_origin, n.width, n.unit_of_measure, n.content, n.type1,
           n.display_status, n.inventory_available,
           n.wholesale::text, n.map::text, n.tariff_pct::text,
           s.vert_repeat, s.horz_repeat, s.repeat_uom, s.width_uom, s.weight, s.weight_uom,
           s.prop_65, s.prop_65_chemical, s.prop_65_effect, s.ca_tb117, s.ab_1817, s.ufac,
           s.direction, s.lead_time_days, s.minimum_order_qty, s.order_increment_qty,
           s.horizontal_half_drop, s.barcode, s.memo_sample_available, s.ship_from,
           s.clean_code, s.durability, s.notes, s.wallcovering_area,
           s.qty_on_hand, s.memo_sample_qty
    FROM kravet_diff_new_2026_04_20 n
    JOIN kravet_sheet_fields s ON s.mfr_sku_norm = regexp_replace(
        regexp_replace(upper(btrim(n.mfr_sku)),'-','.','g'),'\.0\$','')
    WHERE n.new_dw_sku = 'z'
    �mfr_sku�pattern_name�
color_name�brand�
collection�country_of_origin�width�unit_of_measure�content�type1�display_status�inventory_available�	wholesale�map�
tariff_pct�vert_repeat�horz_repeat�
repeat_uom�	width_uom�weight�
weight_uom�prop_65�prop_65_chemical�prop_65_effect�ca_tb117�ab_1817�ufac�	direction�lead_time_days�minimum_order_qty�order_increment_qty�horizontal_half_drop�barcode�memo_sample_available�	ship_from�
clean_code�
durability�notes�wallcovering_area�qty_on_hand�memo_sample_qtyN)r/�dict�zip)rr-�cols�rowss&   r�fetchr~+s���
�"�(�#�	�A� V�I�V�n�V�\�V�'�V�,�V�GZ�V��V�%�V�&/�V�07�V�8H�V�I^�V��V��V�*�V�+8�V�9F�V�GS�V�T_�V�
�V�"�V�#,�V�-?�V�@P�V�Q[�V�
�	V��	V�)�	V�*:�	V�;N�	V�Od�	V�

#�V�
$-�V�
.E�V�
FQ�V�
R^�V�
�
V�!�
V�"5�
V�6C�
V�DU�
V�D��1�:�D�'+�4��D�q�'�"�#�5��5rOc�Raa�.oVV3RlpV!RRVR,4V!RRVR,4T!RR\VR,;'gR44T!RR\VR,;'gR44T!RR\VR,;'gR44T!RR	\VR	,;'gR44T!RR
\VR
,;'gR44T!RR\VR
,;'gR44T!RR
\VR,;'gR44T!RR\VR
,;'gR44T!RR\VR,;'gR44V!RRVR,4V!RRVR,4T!RR\VR,;'gR44V!RRVR,4T!RR\VR,;'gR44V!RRVR,4V!RRVR,4V!RRVR,4V!RRVR ,4V!RR!VR",4V!RR#VR$,4V!RR%VR&,4V!RR'VR(,4V!RR)VR*,4V!RR+VR+,4V!RR,VR,,4V!RR-VR-,4V!RR.VR/,4V!RR0VR1,4V!RR2VR3,4V!RR4VR5,4V!RR6VR5,4V!RR7VR8,4V!RR9VR:,4V!RR;VR<,4V!RR=VR>,4V!RR?VR@,4V!RRAVRB,4V!RRCVRC,4V!RRDVRD,4V!RREVRF,4S#)Gc�<�VeVR9dR#SPRSRVRVR\V4P4RR/4R#)N�ownerId�	namespace�key�value�type�single_line_text_field)r�NULL)�append�strr+)�ns�k�v�outrs&&&��r�add�!build_all_metafields.<locals>.addIsD����9��[�(�&��
�
�I�s�K��U�A��S��V�\�\�^�V�5M�O�	PrO�custom�manufacturer_skurQ�dwc�colorrSr�real_color_namerRrT�real_vendor�globalz	Color-Way�Brand�
CollectionrUrWrXzCountry-of-OriginrV�ContentrY�Type1rZzVert-Rptr`zHorz-Rptra�Weightrd�	DirectionrlzProp-65rfzCA-TB117ri�UFACrkz
Clean-Codert�
DurabilityrurgrhrjzLead-Time-in-Daysrmz	Ship-FromrszMemo-Sample-Availablerr�Minimumrn�v_prods_quantity_order_min�v_prods_quantity_order_unitsro�HORIZONTAL_HALFDROPrpzDisplay-Statusr[zInventory-Availabler\z
WHLS-Pricer]�vendor_notesrvrxry�wallcover_length_ydrw)rN)�itemrr�r�s&f @r�build_all_metafieldsr�Gs����
�C�P���#�T�)�_�5���#�T�)�_�5����J�t�L�/A�/G�/G�R�$H�I���"�J�t�L�/A�/G�/G�R�$H�I����J�t�L�/A�/G�/G�R�$H�I����J�t�N�/C�/I�/I�r�$J�K����J�t�G�}�/B�/B��$C�D����J�t�G�}�/B�/B��$C�D����J�t�L�/A�/G�/G�R�$H�I����z�$�w�-�2E�2E�2�'F�G����z�$�|�2D�2J�2J��'K�L����t�G�}�5���"�t�,=�'>�?���$�z�$�7J�2K�2Q�2Q�r�'R�S����t�I��7����z�$�w�-�2E�2E�2�'F�G����t�M�':�;����t�M�':�;����t�H�~�6����t�K�'8�9����t�I��7����t�J�'7�8����t�F�|�4����t�L�'9�:����t�L�'9�:���#�t�,>�'?�@���!�t�,<�'=�>����t�I��7���$�$�/?�*@�A����$�{�*;�<���(�$�/F�*G�H����$�/B�*C�D���-��6I�1J�K���/��6K�1L�M���&�$�/E�*F�G���!�$�/?�*@�A���&�$�/D�*E�F����$�{�*;�<����$�w�-�8����$�}�*=�>���"�$�/@�*A�B���&�$�/B�*C�D��JrOz�
mutation metafieldsSet($metafields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $metafields) {
    metafields { id namespace key }
    userErrors { field message }
  }
}
z  z: not found in PGr&z: z! metafields to set, chunked at 25�
metafields�
metafieldsSet�
userErrorsz  saved �/z
  errors: :N�N)N)!�__doc__r�urllib.requestrr(�SHOP�os�environ�getr�APIr�PRODUCTSrr/rNr~r��METAFIELDS_SET�pr��print�mfs�len�total_ok�errs�ranger8�chunkr�saved�ue�extend�rOr�<module>r�s���Z�'�'�	4��	�����-�b�	1��	���T�F�+�c�U�-�
8���}�e�%J�K�
�}�e�%J�K����N�1�6�8=�@��
�A���8���D��
��1�X�;�-�0�1�2��
�t�Q�u�X�
.�C�	�B�q��{�m�2�c�#�h�Z�'H�
I�J��H�
�D�
�1�c�#�h��
#���A�a��d������u� 5�6���/�"�<�0�6�6�B���/�"�<�0�6�6�B���C��J���
�2��K�K��O�$�
�H�X�J�a��C��z�
*�+��t�
�
�4��8�*�%�&�'
rO