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

Source Faker: Enable zero-config execution by making 'count' an optional config param #36167

Merged
merged 8 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data:
connectorSubtype: api
connectorType: source
definitionId: dfd88b22-b603-4c3d-aad7-3701784586b1
dockerImageTag: 6.0.2
dockerImageTag: 6.0.3
dockerRepository: airbyte/source-faker
documentationUrl: https://docs.airbyte.com/integrations/sources/faker
githubIssueLabel: source-faker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "6.0.2"
version = "6.0.3"
name = "source-faker"
description = "Source implementation for fake but realistic looking data."
authors = [ "Airbyte <evan@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from .streams import Products, Purchases, Users


DEFAULT_COUNT = 1_000


class SourceFaker(AbstractSource):
def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> Tuple[bool, Any]:
if type(config["count"]) == int or type(config["count"]) == float:
Expand All @@ -19,7 +22,7 @@ def check_connection(self, logger: AirbyteLogger, config: Mapping[str, Any]) ->
return False, "Count option is missing"

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
count: int = config["count"] if "count" in config else 0
count: int = config["count"] if "count" in config else DEFAULT_COUNT
seed: int = config["seed"] if "seed" in config else None
records_per_slice: int = config["records_per_slice"] if "records_per_slice" in config else 100
always_updated: bool = config["always_updated"] if "always_updated" in config else True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Faker Source Spec",
"type": "object",
"required": ["count"],
"required": [],
"additionalProperties": true,
"properties": {
"count": {
"title": "Count",
"description": "How many users should be generated in total. This setting does not apply to the purchases or products stream.",
"description": "How many users should be generated in total. By default, one purchase per user will also be created. This setting does not apply to the products stream.",
aaronsteers marked this conversation as resolved.
Show resolved Hide resolved
"type": "integer",
"minimum": 1,
"default": 1000,
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.3 | 2024-03-15 | [36167](https://github.com/airbytehq/airbyte/pull/36167) | Make 'count' an optional config parameter. |
| 6.0.2 | 2024-02-12 | [35174](https://github.com/airbytehq/airbyte/pull/35174) | Manage dependencies with Poetry. |
| 6.0.1 | 2024-02-12 | [35172](https://github.com/airbytehq/airbyte/pull/35172) | Base image migration: remove Dockerfile and use the python-connector-base image |
| 6.0.0 | 2024-01-30 | [34644](https://github.com/airbytehq/airbyte/pull/34644) | Declare 'id' columns as primary keys. |
Expand Down
Loading