Skip to content

Commit

Permalink
Merge branch 'main' into edgarrmondragon/feat/nested-nullable-props
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon authored Oct 9, 2024
2 parents 8222ff4 + 2be3f09 commit 36de027
Show file tree
Hide file tree
Showing 40 changed files with 796 additions and 493 deletions.
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Bug Report
description: File a bug report
title: "bug: <title>"
labels: ["kind/Bug", "valuestream/SDK"]
type: Bug
assignees:
- edgarrmondragon

body:
- type: markdown
Expand Down Expand Up @@ -29,13 +31,12 @@ body:
label: Python Version
description: Version of Python you are using
options:
- "NA"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7 or earlier"
- "NA"
- "3.8 or earlier"
validations:
required: true
- type: dropdown
Expand All @@ -60,7 +61,7 @@ body:
description: What operating system you are using
placeholder: "Windows"
validations:
required: true
required: false
- type: textarea
id: what-happened
attributes:
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Documentation change
description: Request a documentation change
title: "docs: <title>"
labels: ["Documentation", "valuestream/SDK"]
assignees:
- edgarrmondragon

body:
- type: markdown
Expand Down
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Feature request
description: Request a new feature
title: "feat: <title>"
labels: ["kind/Feature", "valuestream/SDK"]
type: Enhancement
assignees:
- meltano/engineering
- edgarrmondragon

body:
- type: markdown
Expand All @@ -16,7 +17,8 @@ body:
label: Feature scope
description: Functionality this new feature would impact
options:
- Taps (catalog, state, stream maps, tests, etc.)
- Taps (catalog, state, tests, etc.)
- Inline mapping (stream maps, flattening, etc.)
- Targets (data type handling, batching, SQL object generation, tests, etc.)
- Configuration (settings parsing, validation, etc.)
- CLI (options, error messages, logging, etc.)
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/api-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
run: |
python -Im pip install -U pip
pipx install griffe nox
pipx inject nox nox-poetry
pipx list
- name: Set REF
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
griffe==1.3.1
griffe==1.3.2
pip==24.2
poetry==1.8.3
poetry-plugin-export==1.8.0
poetry-dynamic-versioning==1.4.1
pre-commit==3.8.0
pre-commit==4.0.0
nox==2024.4.15
nox-poetry==1.0.3
3 changes: 0 additions & 3 deletions .github/workflows/cookiecutter-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
poetry --version
poetry self show plugins
- uses: actions/setup-python@v5
with:
Expand All @@ -67,7 +65,6 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install nox
pipx inject nox nox-poetry
nox --version
- name: Run Nox
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
name: Packages
path: dist
- name: Publish
uses: pypa/[email protected].2
uses: pypa/[email protected].3

upload-to-release:
name: Upload files to release
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,6 @@ jobs:
with:
fetch-depth: 0

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand All @@ -87,7 +77,6 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
nox --version
- uses: actions/cache@v4
Expand Down Expand Up @@ -126,16 +115,6 @@ jobs:
with:
fetch-depth: 0

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
pipx inject poetry poetry-dynamic-versioning[plugin]
poetry --version
poetry self show plugins
- uses: actions/setup-python@v5
with:
python-version: ${{ env.NOXPYTHON }}
Expand All @@ -152,7 +131,6 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
nox --version
- name: Run Nox
Expand All @@ -167,16 +145,6 @@ jobs:
NOXSESSION: coverage
steps:
- uses: actions/checkout@v4

- name: Install Poetry
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install poetry
pipx inject poetry poetry-plugin-export
poetry --version
poetry self show plugins
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand All @@ -198,7 +166,6 @@ jobs:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
run: |
pipx install 'nox[uv]'
pipx inject nox nox-poetry
nox --version
- run: nox --install-only
Expand Down
10 changes: 2 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-json
exclude: |
Expand Down Expand Up @@ -35,12 +35,6 @@ repos:
tests/snapshots/.*
)$
- id: trailing-whitespace
exclude: |
(?x)^(
.bumpversion.cfg|
singer_sdk/helpers/_simpleeval.py|
tests/core/test_simpleeval.py
)$

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.3
Expand All @@ -50,7 +44,7 @@ repos:
- id: check-readthedocs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.8
rev: v0.6.9
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

build:
os: ubuntu-22.04
os: ubuntu-24.04
tools:
python: "3.12"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class {{ cookiecutter.name }}Mapper(InlineMapper):
th.Property(
"example_config",
th.StringType,
title="Example Configuration",
description="An example config, replace or remove based on your needs.",
),
).to_dict()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ class Tap{{ cookiecutter.source_name }}({{ 'SQL' if cookiecutter.stream_type ==
th.StringType,
required=True,
secret=True, # Flag config as protected.
title="Auth Token",
description="The token to authenticate against the API service",
),
th.Property(
"project_ids",
th.ArrayType(th.StringType),
required=True,
title="Project IDs",
description="Project IDs to replicate",
),
th.Property(
Expand All @@ -47,6 +49,7 @@ class Tap{{ cookiecutter.source_name }}({{ 'SQL' if cookiecutter.stream_type ==
th.Property(
"api_url",
th.StringType,
title="API URL",
default="https://api.mysample.com",
description="The url for the API service",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,27 @@ class Target{{ cookiecutter.destination_name }}({{ target_class }}):
"sqlalchemy_url",
th.StringType,
secret=True, # Flag config as protected.
title="SQLAlchemy URL",
description="SQLAlchemy connection string",
),
{%- else %}
th.Property(
"filepath",
th.StringType,
title="Output File Path",
description="The path to the target output file",
),
th.Property(
"file_naming_scheme",
th.StringType,
title="File Naming Scheme",
description="The scheme with which output files will be named",
),
th.Property(
"auth_token",
th.StringType,
secret=True, # Flag config as protected.
title="Auth Token",
description="The path to the target output file",
),
{%- endif %}
Expand Down
1 change: 0 additions & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ With `pipx` installed, you globally add the required tools:
pipx install poetry
pipx install pre-commit
pipx install nox
pipx inject nox nox-poetry
```

Now you can use Poetry to install package dependencies:
Expand Down
7 changes: 4 additions & 3 deletions docs/guides/config-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class MyTap(Tap):
name = "my-tap"

config_jsonschema = th.PropertiesList(
th.Property("api_key", th.StringType, required=True),
th.Property("base_url", th.StringType, default="https://api.example.com"),
th.Property("start_date", th.DateTimeType),
th.Property("api_key", th.StringType, required=True, title="API Key"),
th.Property("base_url", th.StringType, default="https://api.example.com", title="Base URL"),
th.Property("start_date", th.DateTimeType, title="Start Date"),
).to_dict()
```

Expand All @@ -29,6 +29,7 @@ Explanation of the configuration schema defined above:
- The `th.StringType`, `th.DateTimeType`, etc. helpers are used to define the type of the property.
- The `required` attribute is used to mark a property as required. The tap will throw an error if the user does not provide a value for a required property.
- The `default` attribute is used to provide a default value for a property. The tap will use this if the user does not provide a value, so this can be accessed in the tap or streams with square bracket syntax, i.e. `self.config["base_url"]`.
- The `title` attribute is used to provide a human-readable title for the property.
- The `to_dict()` method is used to convert the JSON object to a Python dictionary.

See the full reference for the [typing module](../typing.rst) for more information on how to define a configuration schema.
1 change: 0 additions & 1 deletion docs/implementation/cli.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---
# TODO: this will be supported after MyST-Parser 0.18.0 is released
myst:
heading_anchors: 4
---
Expand Down
41 changes: 40 additions & 1 deletion docs/stream_maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,19 @@ The `faker` object.
The `Faker` class.
:::

:::{versionchanged} TODO
:::{versionchanged} 0.41.0
The `Faker` class was deprecated in favor of instance methods on the `fake` object.
:::

#### Built-in Alias Variable Names

The following variables are available in the context of the `__alias__` expression:
- `__stream_name__` - the existing stream name

:::{versionadded} 0.42.0
The `__stream_name__` variable.
:::

#### Automatic Schema Detection

For performance reasons, type detection is performed at runtime using text analysis
Expand Down Expand Up @@ -640,6 +649,36 @@ stream_maps:
Support for stream glob expressions.
:::

### Aliasing two or more streams

The `__alias__` operation evaluates simple python expressions.

You can combine this with glob expressions to rename more than one stream:

````{tab} meltano.yml
```yaml
stream_maps:
"*":
__alias__: "__stream_name__ + '_v2'"
```
````

````{tab} JSON
```json
{
"stream_maps": {
"*": {
"__alias__": "__stream_name__ + '_v2'"
}
}
}
```
````

:::{versionadded} 0.42.0
Support for `__alias__` expression evaluation.
:::

### Understanding Filters' Affects on Parent-Child Streams

Nested child streams iterations will be skipped if their parent stream has a record-level
Expand Down
Loading

0 comments on commit 36de027

Please sign in to comment.