-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 Linnworks: improve streams ProcessedOrders and ProcessedOrderDetails #8226
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @monai, thanks for this contrib and improvements. I'm facing some error running the acceptance test that are related to schema validation during test_read
. Looks like we have empty field that are not accepted by your schema.
{"type": "LOG", "log": {"level": "ERROR", "message": "\nThe stock_locations stream has the following schema errors:\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BinRack']:\n {'description': 'Bin rack', 'type': 'string'}\n\nOn instance['BinRack']:\n None"}}
{"type": "LOG", "log": {"level": "ERROR", "message": "\nThe stock_items stream has the following schema errors:\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['StockLevels']['items']['properties']['SKU']:\n {'description': 'Product SKU', 'type': 'string'}\n\nOn instance['StockLevels'][1]['SKU']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['Images']['items']['properties']['ChecksumValue']:\n {'description': 'Internal checksum value', 'type': 'string'}\n\nOn instance['Images'][0]['ChecksumValue']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['Images']['items']['properties']['RawChecksum']:\n {'description': 'Raw file checksum (Used for UI to determine if the '\n 'image file is the same before submitting for upload)',\n 'type': 'string'}\n\nOn instance['Images'][0]['RawChecksum']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['PackageGroupName']:\n {'description': 'Default package group name', 'type': 'string'}\n\nOn instance['PackageGroupName']:\n None"}}
{"type": "LOG", "log": {"level": "ERROR", "message": "\nThe processed_orders stream has the following schema errors:\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['cShippingAddress']:\n {'description': \"Customer's shipping address\", 'type': 'string'}\n\nOn instance['cShippingAddress']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['Vendor']:\n {'description': 'Courier name (e.g. DPD)', 'type': 'string'}\n\nOn instance['Vendor']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingEmailAddress']:\n {'type': 'string'}\n\nOn instance['BillingEmailAddress']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['PackageCategory']:\n {'description': 'Package category', 'type': 'string'}\n\nOn instance['PackageCategory']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['PackageTitle']:\n {'description': 'Package name', 'type': 'string'}\n\nOn instance['PackageTitle']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['FolderCollection']:\n {'description': 'Folder name of an order', 'type': 'string'}\n\nOn instance['FolderCollection']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['cBillingAddress']:\n {'description': 'Customer billing address', 'type': 'string'}\n\nOn instance['cBillingAddress']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingName']:\n {'description': 'Customer billing name', 'type': 'string'}\n\nOn instance['BillingName']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingCompany']:\n {'description': 'Customer billing company', 'type': 'string'}\n\nOn instance['BillingCompany']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingAddress1']:\n {'description': 'Billing address line one', 'type': 'string'}\n\nOn instance['BillingAddress1']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingAddress2']:\n {'description': 'Billing address line two', 'type': 'string'}\n\nOn instance['BillingAddress2']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingAddress3']:\n {'description': 'Billing address line three', 'type': 'string'}\n\nOn instance['BillingAddress3']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingTown']:\n {'description': 'Billing town', 'type': 'string'}\n\nOn instance['BillingTown']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingRegion']:\n {'description': 'Billing region, area, county', 'type': 'string'}\n\nOn instance['BillingRegion']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingPostCode']:\n {'description': 'Billing postcode', 'type': 'string'}\n\nOn instance['BillingPostCode']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingCountryName']:\n {'description': 'Billing country', 'type': 'string'}\n\nOn instance['BillingCountryName']:\n None\n--------------------------------------------------------------------------------\nNone is not of type 'string'\n\nFailed validating 'type' in schema['properties']['BillingPhoneNumber']:\n {'description': 'Billing phone number', 'type': 'string'}\n\nOn instance['BillingPhoneNumber']:\n None"}}
EDIT: I made the required changes to the catalogs / schema to make the acceptance test pass with our sandbox Linnwork account. But I'm afraid that the main build of this connector is failing for a reason I can't figure out:
atched_error = ContainerError('Command \'discover --config tap_config.json\' in image \'sha256:a83076bf3e0e5ccee0a9cdbd2d7571e126a450... validation_error.message) from None\nException: Config validation error: \'application_id\' is a required property\n')
Our CI credentials are exactly the same that I use locally...
@@ -207,12 +207,12 @@ def request_body_data( | |||
self, stream_state: Mapping[str, Any], stream_slice: Mapping[str, any] = None, next_page_token: Mapping[str, Any] = None | |||
) -> MutableMapping[str, Any]: | |||
request = { | |||
"DateField": "received", | |||
"DateField": "processed", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this field depends of the cursor storing a mapping between cursor field and date field could be interesting in case of future updates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The objects that this stream pulls have several date fields indicating the order's lifecycle, i.e., received, processed, canceled, etc. See the documentation.
The received date is the first date that is set upon order creation. The processed date will always be later. Therefore in the case of existing data, after connector upgrade, some orders might be refetched. But that's not a problem at all. In full_refresh sync, they get duplicated anyway, and in incremental sync, they get deduped according to primary_key.
Have I answered your concern? If not, would you please elaborate more on what concerns you with this change?
It might be the change in their API. However, documentation hasn't changed yet. I had the same issue with the 3PL Central connector, where documentation wasn't updated together with the code.
It looks like something's wrong with your CI setup. Generated file The code works for me with two different accounts as expected: ~/projects/lt/airbyte/airbyte-integrations/connectors/source-linnworks (linnworks-pod) [um] git rev-parse HEAD
9fa54aec5a6bc4efedfd06921094d710f851c100
~/projects/lt/airbyte/airbyte-integrations/connectors/source-linnworks (linnworks-pod) [um] python main.py discover --config secrets/config.json | jq
{
"type": "CATALOG",
"catalog": {
"streams": [
{
"name": "stock_locations",
"json_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
... |
Yes we're trying to figure this out, will keep you updated. |
What
This PR makes two changes to the following streams:
dReceivedDate
todProcessedOn
in the streamProcessedOrders
. The latter field more accurately reflects the stream's nature and allows the implementation of the following change.ProcessedOrderDetails
sync mode to incremental. Both streams contain a property with aprocessed timestamp. Therefore, it can be transparently passed to the parent stream
ProcessedOrder
and make the child stream incremental.Other changes:
Recommended reading order
streams.py
🚨 User Impact 🚨
🚨🚨 The cursor field of stream
ProcessedOrders
changed fromdReceivedDate
todProcessedOn
.Pre-merge Checklist
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described here