airbytehq / airbyte

The leading data integration platform for ETL / ELT data pipelines from APIs, databases & files to data warehouses, data lakes & data lakehouses. Both self-hosted and Cloud-hosted.
https://airbyte.com
Other
16.07k stars 4.11k forks source link

[source-prestashop] expecting schemas folder but doesn't exist this folder #39394

Open jordi-ydteam opened 4 months ago

jordi-ydteam commented 4 months ago

Connector Name

source-prestashop

Connector Version

1.0.4

What step the error happened?

Configuring a new connector

Relevant information

I tried to created a new PrestaShop source.

I added the Access Key, Shop URL and Start date.

When I click in set up source I receive an error.

Relevant log output

nternal message: [Errno 2] No such file or directory: '/airbyte/integration_code/source_prestashop/schemas/addresses.json'
Failure type: system_error

StackTrace:

    self._constructor.create_component(
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py", line 240, in create_component
    return self._create_component_from_model(model=declarative_component_model, config=config, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py", line 248, in _create_component_from_model
    return component_constructor(model=model, config=config, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py", line 606, in create_declarative_stream
    transformations.append(self._create_component_from_model(model=transformation_model, config=config))
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py", line 248, in _create_component_from_model
    return component_constructor(model=model, config=config, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py", line 462, in create_custom_component
    return custom_component_class(**kwargs)
  File "<string>", line 4, in __init__
  File "/airbyte/integration_code/source_prestashop/components.py", line 26, in __post_init__
    self._schema = self._get_schema_root_properties()
  File "/airbyte/integration_code/source_prestashop/components.py", line 31, in _get_schema_root_properties
    schema = schema_loader.get_json_schema()
  File "/usr/local/lib/python3.9/site-packages/airbyte_cdk/sources/declarative/schema/json_file_schema_loader.py", line 58, in get_json_schema
    raw_json_file = pkgutil.get_data(resource, schema_path)
  File "/usr/local/lib/python3.9/pkgutil.py", line 639, in get_data
    return loader.get_data(resource_name)
  File "<frozen importlib._bootstrap_external>", line 1039, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/airbyte/integration_code/source_prestashop/schemas/addresses.json'

Contribute

marcosmarxm commented 4 months ago

The connector was migrated to use inline schemas: https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-prestashop/source_prestashop/manifest.yaml It is strange it is trying to access the schema file instead of using the inline one.

jordi-ydteam commented 4 months ago

The error is comming from the components.py file? I guess that it is happening here?

ef _get_schema_root_properties(self):
        schema_loader = JsonFileSchemaLoader(config=self.config, parameters={"name": self.name})
        schema = schema_loader.get_json_schema()
        return schema["properties"]

I am not sure how to read the schemas from the manifest.yaml file instead of the schemas folder

marcosmarxm commented 4 months ago

Yes, @jordi-ydteam can you rollback to previous version?

jordi-ydteam commented 4 months ago

I tried with the docker version and it seems that the connection is working.

What I don't know, because I cannot find the commit or Pull request that was created to change to inline schemas, if another changes were made

marcosmarxm commented 4 months ago

This is the pull request https://github.com/airbytehq/airbyte/pull/37233

marcosmarxm commented 4 months ago

I tried to insert the schema in the custom transformation but it doesn't work like that. Probably the solution is to read the manifest.yaml and parse each stream. It is doable but def not easy.

aledelgo commented 3 weeks ago

same problem here, i've noticed the problem appear also on the CLOUD jitsu platform