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-woocomerce] rate_id Field in order.tax_lines Stream Has Incorrect Data Type in manifest.yaml #48858

Open
1 task
jordi-ydteam opened this issue Dec 9, 2024 · 0 comments

Comments

@jordi-ydteam
Copy link

Connector Name

source-woocommerce

Connector Version

0.5

What step the error happened?

During the sync

Relevant information

The rate_id field in the order.tax_lines stream of the WooCommerce connector is incorrectly defined in the manifest.yaml file. According to the current definition (line 2449 of the manifest.yaml), the rate_id field is specified as either null or string:

rate_id:
  type:
    - "null"
    - string

However, based on WooCommerce’s official REST API documentation (Order Tax Lines Properties), the rate_id is clearly defined as an integer.

This discrepancy causes the Airbyte connector to fail during data type validation when syncing WooCommerce orders. Specifically, it raises an error when processing the tax_lines field in the order stream.

Error Details

The specific error encountered is as follows:

tech.allegro.schema.json2avro.converter.AvroConversionException: Failed to convert JSON to Avro: Could not evaluate union, field tax_lines is expected to be one of these: NULL, ARRAY. If this is a complex type, check if offending field (path: tax_lines.rate_id) adheres to schema: [{id=479, rate_code=BACKOFFICE PROCESSING FEE-1, rate_id=1, label=Backoffice Processing Fee, compound=false, tax_total=28.00, shipping_tax_total=0.00, rate_percent=4, meta_data=[]}]

The error indicates that the rate_id field (value 1 in this case) is expected to be a string or null, as defined in the manifest.yaml. However, WooCommerce returns this field as an integer, which is consistent with their API documentation.

Impact

This mismatch prevents the successful processing of the order stream when the tax_lines field is included. It particularly affects users who rely on accurate data ingestion for orders that include tax lines with valid rate_id values.

Proposed Solution

Update the manifest.yaml file to correctly define the rate_id field in the tax_lines structure as an integer (or allow both integer and null values). The corrected definition should look like this:

rate_id:
  type:
    - "null"
    - integer

This change will align the connector’s schema with WooCommerce’s documented API specifications and ensure seamless data ingestion.

Relevant log output

tech.allegro.schema.json2avro.converter.AvroConversionException: Failed to convert JSON to Avro: Could not evaluate union, field tax_lines is expected to be one of these: NULL, ARRAY. If this is a complex type, check if offending field (path: tax_lines.rate_id) adheres to schema: [{id=479, rate_code=BACKOFFICE PROCESSING FEE-1, rate_id=1, label=Backoffice Processing Fee, compound=false, tax_total=28.00, shipping_tax_total=0.00, rate_percent=4, meta_data=[]}]

Contribute

  • Yes, I want to contribute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants