CAT investigation: validation checks aren't catching date format issues
- Langage dominant
- Python
- Étoiles
- 22.1k
- Forks
- 5.3k
- Métriques de merge des PR
- Métriques de PR en attente
Description
@josephkmh recently had to fix the Source NYTimes connector, whose config & spec were being rejected by the platform due to an invalid date format.
We have CATs that should theoretically cover this and/or similar issues:
- [`test_config_match_spec`](https://github.com/airbytehq/airbyte/blob/929bf06368c46672a97a3db717af145f26855a2f/airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py#L138), which calls `jsonschema.validate()`.
- [`test_date_pattern`](https://github.com/airbytehq/airbyte/blob/929bf06368c46672a97a3db717af145f26855a2f/airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py#L138), which checks that properties with a `format` of `date` or `datetime` have a pattern that matches a hardcoded date pattern, but currently only logs a warning if the pattern doesn't match, and more importantly the pattern that is compared against does not seem appropriate as the only pattern that we support.
- [`test_date_format`](https://github.com/airbytehq/airbyte/blob/929bf06368c46672a97a3db717af145f26855a2f/airbyte-integrations/bases/connector-acceptance-test/connector_acceptance_test/tests/test_core.py#L416), which checks that properties with pattern that looks like a date should have their format set to date or date-time, and has the same issues as `test_date_pattern`.
This ticket is to 1) investigate why our `jsonschema.validate()` did not catch the problem before the config/spec was sent to the platform, and 2) take a look at the `test_date_*` tests and see whether these should be modified to include a more robust check, or should be deleted altogether.
Details on what the platform is doing to validate schema are in the Slack thread [here](https://airbytehq-team.slack.com/archives/C03VDJ4FMJB/p1720537414878449).
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.