From e8fc8925043f46ca7a6815bd38b7a2d69c9bc2f7 Mon Sep 17 00:00:00 2001 From: ReubenFrankel <60552974+ReubenFrankel@users.noreply.github.com> Date: Mon, 5 Feb 2024 23:24:07 +0000 Subject: [PATCH] feat: Update SDK version to support generating fake data (#218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #215 --------- Co-authored-by: Edgar Ramírez-Mondragón --- .github/workflows/meltano-run.yml | 5 +++++ meltano.yml | 11 +++++++++++ poetry.lock | 30 +++++++++++++++++++++++------- pyproject.toml | 2 +- 4 files changed, 40 insertions(+), 8 deletions(-) diff --git a/.github/workflows/meltano-run.yml b/.github/workflows/meltano-run.yml index bd33e17..cae3ea0 100644 --- a/.github/workflows/meltano-run.yml +++ b/.github/workflows/meltano-run.yml @@ -28,6 +28,11 @@ jobs: output_db: nested.db target_table: users install_extractor: false + - tap: tap-csv + mapping: fake + output_db: tap_csv.db + target_table: customers + install_extractor: false steps: - uses: actions/checkout@v4 diff --git a/meltano.yml b/meltano.yml index 1e45ca9..787453f 100644 --- a/meltano.yml +++ b/meltano.yml @@ -72,6 +72,17 @@ plugins: users: id: id fields: "[f for f in fields if f['key'] != 'age']" + - name: fake + config: + stream_maps: + customers: + id: id + first_name: first_name + cc: fake.credit_card_number() # add a new field with a fake credit card number + __else__: __NULL__ + faker_config: + locale: [en_US] + seed: 123456 environments: - name: dev config: diff --git a/poetry.lock b/poetry.lock index 796be19..ce1d872 100644 --- a/poetry.lock +++ b/poetry.lock @@ -111,13 +111,13 @@ tzdata = ["tzdata"] [[package]] name = "certifi" -version = "2023.11.17" +version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, - {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, ] [[package]] @@ -376,6 +376,21 @@ files = [ [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "faker" +version = "22.7.0" +description = "Faker is a Python package that generates fake data for you." +optional = false +python-versions = ">=3.8" +files = [ + {file = "Faker-22.7.0-py3-none-any.whl", hash = "sha256:d12edbac08a82a75ecd588f299f44f12e33f000c15fe414abc417f0836cb51ae"}, + {file = "Faker-22.7.0.tar.gz", hash = "sha256:f797529ebeb9bd9e1851106b99e156c9bebe67d2730c8393a1705ed1c864f1bf"}, +] + +[package.dependencies] +python-dateutil = ">=2.4" +typing-extensions = {version = ">=3.10.0.1", markers = "python_version <= \"3.8\""} + [[package]] name = "fs" version = "2.4.16" @@ -479,13 +494,13 @@ files = [ [[package]] name = "importlib-metadata" -version = "6.11.0" +version = "7.0.1" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-6.11.0-py3-none-any.whl", hash = "sha256:f0afba6205ad8f8947c7d338b5342d5db2afbfd82f9cbef7879a9539cc12eb9b"}, - {file = "importlib_metadata-6.11.0.tar.gz", hash = "sha256:1231cf92d825c9e03cfc4da076a16de6422c863558229ea0b22b675657463443"}, + {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, + {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, ] [package.dependencies] @@ -1180,6 +1195,7 @@ backoff = {version = ">=2.0.0", markers = "python_version < \"4\""} backports-datetime-fromisoformat = {version = ">=2.0.1", markers = "python_version < \"3.11\""} click = ">=8.0,<9.0" cryptography = ">=3.4.6" +faker = {version = ">=22.5,<23.0", optional = true, markers = "extra == \"faker\""} fs = ">=2.4.16" importlib-metadata = {version = "<8.0.0", markers = "python_version < \"3.12\""} importlib-resources = {version = ">=5.12.0", markers = "python_version < \"3.9\""} @@ -1373,4 +1389,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.8" -content-hash = "d1c1d6a786616d25f36ce201a225fa0146b3a613540e93a2c832af0be99241b9" +content-hash = "018a46c906a0f72ba7ba10461a4b82601a09ed2467e9c82f608ee07ec06dd254" diff --git a/pyproject.toml b/pyproject.toml index 587f626..27d8065 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ documentation = "https://github.com/MeltanoLabs/meltano-map-transform#readme" [tool.poetry.dependencies] python = ">=3.8" -singer-sdk = "~=0.35.0" +singer-sdk = {version = "~=0.35.0", extras = ["faker"]} [tool.poetry.dev-dependencies] pytest = ">=7.4.4"