Skip to content

Commit d447695

Browse files
aaronsteersjatinyadav-cc
authored andcommitted
Source Faker: Declare primary keys (airbytehq#34644)
1 parent e08a9f5 commit d447695

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

airbyte-integrations/connectors/source-faker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ COPY source_faker ./source_faker
3434
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
3535
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
3636

37-
LABEL io.airbyte.version=5.0.2
37+
LABEL io.airbyte.version=6.0.0
3838
LABEL io.airbyte.name=airbyte/source-faker

airbyte-integrations/connectors/source-faker/metadata.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ data:
77
connectorSubtype: api
88
connectorType: source
99
definitionId: dfd88b22-b603-4c3d-aad7-3701784586b1
10-
dockerImageTag: 5.0.2
10+
dockerImageTag: 6.0.0
1111
dockerRepository: airbyte/source-faker
1212
documentationUrl: https://docs.airbyte.com/integrations/sources/faker
1313
githubIssueLabel: source-faker
@@ -30,6 +30,9 @@ data:
3030
ID and products.year fields are changing to be integers instead of
3131
floats.
3232
upgradeDeadline: "2023-08-31"
33+
6.0.0:
34+
message: Declare 'id' columns as primary keys.
35+
upgradeDeadline: "2024-04-01"
3336
resourceRequirements:
3437
jobSpecific:
3538
- jobType: sync

airbyte-integrations/connectors/source-faker/source_faker/streams.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
class Products(Stream, IncrementalMixin):
18-
primary_key = None
18+
primary_key = "id"
1919
cursor_field = "updated_at"
2020

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

6666

6767
class Users(Stream, IncrementalMixin):
68-
primary_key = None
68+
primary_key = "id"
6969
cursor_field = "updated_at"
7070

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

126126

127127
class Purchases(Stream, IncrementalMixin):
128-
primary_key = None
128+
primary_key = "id"
129129
cursor_field = "updated_at"
130130

131131
def __init__(self, count: int, seed: int, parallelism: int, records_per_slice: int, always_updated: bool, **kwargs):

docs/integrations/sources/faker-migrations.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Sample Data (Faker) Migration Guide
22

3+
## Upgrading to 6.0.0
4+
5+
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.
6+
37
## Upgrading to 5.0.0
8+
49
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.
510

611
## Upgrading to 4.0.0

docs/integrations/sources/faker.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ None!
101101

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

0 commit comments

Comments
 (0)