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

🎉 Destination Weaviate: Support any string based ID and fix issues with additionalProperties #22527

Merged
merged 15 commits into from
Feb 28, 2023

Conversation

samos123
Copy link
Contributor

@samos123 samos123 commented Feb 7, 2023

What

  • Previously string based IDs that weren't convertable to hex would throw an exception. This fixes that issue by converting strings to 128 bit integer and converting the md5 hex into a UUID
  • Update Weaviate to 1.17.3
  • fixes issue with arrays of uknown types see Destination Weaviate: Support array of known type #22530
  • Fixes issue with additionalProperties of type object and of type Array/object

How

Convert a string to md5, then use the hex of the md5 to generate a UUID from a string.
Create a json string of uknown array type
Create json string for additional props of type object and type array of objects

🚨 User Impact 🚨

This fixes issues with data sources that have IDs like some string ID that isn't hex, uuid, or integer

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

@samos123 samos123 changed the title 🎉 Destination Redshift: Support any string based ID 🎉 Destination Weaviate: Support any string based ID Feb 7, 2023
@samos123 samos123 force-pushed the weaviate-fix-id-schema-issue branch 3 times, most recently from 5f93dd3 to 555ae3a Compare February 7, 2023 21:40
@samos123 samos123 changed the title 🎉 Destination Weaviate: Support any string based ID 🎉 Destination Weaviate: Support any string based ID and fix issues with additionalProperties Feb 8, 2023
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Feb 8, 2023
@samos123 samos123 force-pushed the weaviate-fix-id-schema-issue branch from be8f724 to 00aad30 Compare February 9, 2023 06:45
@samos123
Copy link
Contributor Author

samos123 commented Feb 9, 2023

rebased with master

@samos123
Copy link
Contributor Author

samos123 commented Feb 9, 2023

integration tests are passing, see screenshot
image

@marcosmarxm marcosmarxm self-assigned this Feb 10, 2023
@marcosmarxm
Copy link
Member

marcosmarxm commented Feb 10, 2023

/test connector=connectors/destination-weaviate

🕑 connectors/destination-weaviate https://github.com/airbytehq/airbyte/actions/runs/4142144002
❌ connectors/destination-weaviate https://github.com/airbytehq/airbyte/actions/runs/4142144002
🐛

Build Passed

Test summary info:

All Passed

@marcosmarxm
Copy link
Member

@samos123 new QA tests are failing because the connector doesn't have an icon. do you mind to add it?

@samos123
Copy link
Contributor Author

I don't know how to add the icon and there doesn't seem to be any docs on how to add an icon: #20864

Could we merge without icon? or could you tell me the steps to add one?

@samos123
Copy link
Contributor Author

after skimming through a bunch of source code finnally found how to add the icon I think? Please review again.

@samos123 samos123 force-pushed the weaviate-fix-id-schema-issue branch from aa2bca4 to aecee60 Compare February 10, 2023 23:46
@samos123
Copy link
Contributor Author

integration tests still passing after latest rebase and commits:
image

@timroes
Copy link
Collaborator

timroes commented Feb 13, 2023

@Upmitt Could you please have a look here to check if the connector icon is in correct shape for what we need, and if not provide a new one please.

@marcosmarxm
Copy link
Member

marcosmarxm commented Feb 13, 2023

/test connector=connectors/destination-weaviate

🕑 connectors/destination-weaviate https://github.com/airbytehq/airbyte/actions/runs/4167933984
✅ connectors/destination-weaviate https://github.com/airbytehq/airbyte/actions/runs/4167933984
Python tests coverage:

Name                                  Stmts   Miss  Cover
---------------------------------------------------------
destination_weaviate/utils.py            59      0   100%
destination_weaviate/__init__.py          2      0   100%
destination_weaviate/client.py          106      6    94%
destination_weaviate/destination.py      35      2    94%
---------------------------------------------------------
TOTAL                                   202      8    96%

Build Passed

Test summary info:

All Passed

@marcosmarxm
Copy link
Member

@samos123 I'll finish tomorrow the reviewing process. Tests are good thanks for that.

@marcosmarxm
Copy link
Member

@samos123 can you fix the errors? ./gradlew :airbyte-integrations:connectors:destination-weaviate:flakeCheck

* Previously string based IDs that weren't convertable to hex would
  throw an exception. This fixes that issue by converting strings
  to 128 bit integer and converting the md5 hex into a UUID
* Update Weaviate to 1.17.3
This seems to happen when records sometimes don't contain all the
properties that are defined in the schema.

This was the error observed by a user connecting Slack <> Weaviate:
property 'reactions': invalid dataType: dataType must have at least
one element, class 'Threads' not present in schema"
@samos123 samos123 force-pushed the weaviate-fix-id-schema-issue branch from be4b76e to ef43e5a Compare February 15, 2023 23:03
@samos123
Copy link
Contributor Author

samos123 commented Feb 15, 2023

@marcosmarxm I've fixed the flake tests, sorry about that. Could you please give it another review? I also rebased with latest master

@marcosmarxm
Copy link
Member

marcosmarxm commented Feb 27, 2023

/publish connector=connectors/destination-weaviate

🕑 Publishing the following connectors:
connectors/destination-weaviate
https://github.com/airbytehq/airbyte/actions/runs/4283470608


Connector Did it publish? Were definitions generated?
connectors/destination-weaviate

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@marcosmarxm
Copy link
Member

marcosmarxm commented Feb 28, 2023

/publish connector=connectors/destination-weaviate

🕑 Publishing the following connectors:
connectors/destination-weaviate
https://github.com/airbytehq/airbyte/actions/runs/4296814438


Connector Did it publish? Were definitions generated?
connectors/destination-weaviate

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

Copy link
Member

@marcosmarxm marcosmarxm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribtuion @samos123 sorry the long delay to publish and merge it.

@marcosmarxm marcosmarxm merged commit 3d73771 into airbytehq:master Feb 28, 2023
@marcosmarxm marcosmarxm mentioned this pull request Mar 3, 2023
37 tasks
danielduckworth pushed a commit to danielduckworth/airbyte that referenced this pull request Mar 13, 2023
…th additionalProperties (airbytehq#22527)

* Support any string based ID

* Previously string based IDs that weren't convertable to hex would
  throw an exception. This fixes that issue by converting strings
  to 128 bit integer and converting the md5 hex into a UUID
* Update Weaviate to 1.17.3

* Fix issue with arrays of no data type

Closes airbytehq#22530

* add more testing coverage

* fix error where dataType wasn't set in weaviate

This seems to happen when records sometimes don't contain all the
properties that are defined in the schema.

This was the error observed by a user connecting Slack <> Weaviate:
property 'reactions': invalid dataType: dataType must have at least
one element, class 'Threads' not present in schema"

* add test case for additionalProperties

* Support additionalProps of object and array of obj

* Update changelog

* add weaviate icon

* fix flake tests

* add commit

* make build m1 work

* make build m1 work

* auto-bump connector version

---------

Co-authored-by: marcosmarxm <marcosmarxm@gmail.com>
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Co-authored-by: Marcos Marx <marcosmarxm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation bounty community connectors/destination/weaviate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants