Skip to content

Source Faker: Declare primary keys #34644

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

Merged
merged 5 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-faker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ COPY source_faker ./source_faker
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=5.0.2
LABEL io.airbyte.version=6.0.0
LABEL io.airbyte.name=airbyte/source-faker
5 changes: 4 additions & 1 deletion airbyte-integrations/connectors/source-faker/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: dfd88b22-b603-4c3d-aad7-3701784586b1
dockerImageTag: 5.0.2
dockerImageTag: 6.0.0
dockerRepository: airbyte/source-faker
documentationUrl: https://docs.airbyte.com/integrations/sources/faker
githubIssueLabel: source-faker
Expand All @@ -30,6 +30,9 @@ data:
ID and products.year fields are changing to be integers instead of
floats.
upgradeDeadline: "2023-08-31"
6.0.0:
message: Declare 'id' columns as primary keys.
upgradeDeadline: "2024-04-01"
resourceRequirements:
jobSpecific:
- jobType: sync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class Products(Stream, IncrementalMixin):
primary_key = None
primary_key = "id"
cursor_field = "updated_at"

def __init__(self, count: int, seed: int, parallelism: int, records_per_slice: int, always_updated: bool, **kwargs):
Expand Down Expand Up @@ -65,7 +65,7 @@ def read_records(self, **kwargs) -> Iterable[Mapping[str, Any]]:


class Users(Stream, IncrementalMixin):
primary_key = None
primary_key = "id"
cursor_field = "updated_at"

def __init__(self, count: int, seed: int, parallelism: int, records_per_slice: int, always_updated: bool, **kwargs):
Expand Down Expand Up @@ -125,7 +125,7 @@ def read_records(self, **kwargs) -> Iterable[Mapping[str, Any]]:


class Purchases(Stream, IncrementalMixin):
primary_key = None
primary_key = "id"
cursor_field = "updated_at"

def __init__(self, count: int, seed: int, parallelism: int, records_per_slice: int, always_updated: bool, **kwargs):
Expand Down
5 changes: 5 additions & 0 deletions docs/integrations/sources/faker-migrations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Sample Data (Faker) Migration Guide

## Upgrading to 6.0.0

All streams (`users`, `products`, and `purchases`) now properly declare `id` as their respective primary keys. Existing sync jobs should still work as expected but you may need to reset your sync and/or update write mode after upgrading to the latest connector version.

## Upgrading to 5.0.0

Some columns are narrowing from `number` to `integer`. You may need to force normalization to rebuild your destination tables by manually dropping the SCD and final tables, refreshing the connection schema (skipping the reset), and running a sync. Alternatively, you can just run a reset.

## Upgrading to 4.0.0
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/faker.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ None!

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :-------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------- |
| 6.0.0 | 2024-01-30 | [34644](https://github.com/airbytehq/airbyte/pull/34644) | Declare 'id' columns as primary keys. |
| 5.0.2 | 2024-01-17 | [34344](https://github.com/airbytehq/airbyte/pull/34344) | Ensure unique state messages |
| 5.0.1 | 2023-01-08 | [34033](https://github.com/airbytehq/airbyte/pull/34033) | Add standard entrypoints for usage with AirbyteLib |
| 5.0.0 | 2023-08-08 | [29213](https://github.com/airbytehq/airbyte/pull/29213) | Change all `*id` fields and `products.year` to be integer |
Expand Down