Skip to content

feat: Add schema alias for default_target_schema setting#3454

Open
KaruturiS wants to merge 8 commits into
meltano:mainfrom
KaruturiS:fix/schema-alias-issue-2766
Open

feat: Add schema alias for default_target_schema setting#3454
KaruturiS wants to merge 8 commits into
meltano:mainfrom
KaruturiS:fix/schema-alias-issue-2766

Conversation

@KaruturiS
Copy link
Copy Markdown

@KaruturiS KaruturiS commented Jan 15, 2026

This PR adds the 'schema' alias to the default_target_schema setting in TARGET_SCHEMA_CONFIG. This allows users to use either key in their configuration, resolving issue #2766.

Summary by Sourcery

New Features:

  • Allow configuring the default target schema using either the default_target_schema or schema key in TARGET_SCHEMA_CONFIG.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jan 15, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds a new configuration alias so that the existing default_target_schema setting can also be specified as schema in TARGET_SCHEMA_CONFIG, improving configurability while maintaining backward compatibility.

Class diagram for updated TARGET_SCHEMA_CONFIG Property with schema alias

classDiagram
    class Property {
        +string name
        +string title
        +string description
        +ConfigType type
        +list~string~ aliases
    }

    class TargetSchemaConfig {
        +Property default_target_schema
    }

    TargetSchemaConfig --> Property : uses

    class DefaultTargetSchemaProperty {
        +name = default_target_schema
        +aliases = [schema]
        +title = Default_Target_Schema
        +description = Default_target_database_schema_name
    }

    DefaultTargetSchemaProperty --|> Property
Loading

File-Level Changes

Change Details Files
Allow the default_target_schema configuration property to be set using an additional schema alias key.
  • Extend the Property definition for default_target_schema to include an aliases=["schema"] parameter.
  • Preserve existing behavior and validation of default_target_schema while adding support for the new alias key in configuration files.
singer_sdk/helpers/capabilities.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 15, 2026

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing KaruturiS:fix/schema-alias-issue-2766 (5048af9) with main (ec2cb65)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.86%. Comparing base (ec2cb65) to head (5048af9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3454   +/-   ##
=======================================
  Coverage   93.86%   93.86%           
=======================================
  Files          73       73           
  Lines        5946     5946           
  Branches      729      729           
=======================================
  Hits         5581     5581           
  Misses        271      271           
  Partials       94       94           
Flag Coverage Δ
core 82.35% <100.00%> (ø)
end-to-end 75.27% <100.00%> (ø)
optional-components 42.80% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edgarrmondragon edgarrmondragon self-assigned this Jan 16, 2026
@edgarrmondragon edgarrmondragon changed the title feat: add 'schema' alias for 'default_target_schema' setting feat: Add schema alias for default_target_schema setting Jan 27, 2026
@edgarrmondragon edgarrmondragon added SQL Support for SQL taps and targets Type/Target Singer targets labels Jan 27, 2026
@edgarrmondragon edgarrmondragon added this to the v0.54 milestone Jan 27, 2026
@edgarrmondragon edgarrmondragon linked an issue Jan 27, 2026 that may be closed by this pull request
1 task
@edgarrmondragon edgarrmondragon force-pushed the fix/schema-alias-issue-2766 branch from 59e8ee4 to 1a4dabb Compare January 27, 2026 00:21
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@edgarrmondragon edgarrmondragon force-pushed the fix/schema-alias-issue-2766 branch from 1a4dabb to 7885dc5 Compare January 27, 2026 00:55
@edgarrmondragon edgarrmondragon removed this from the v0.54 milestone Feb 26, 2026
edgarrmondragon and others added 2 commits April 23, 2026 03:26
… HTTP request for a stream (meltano#3483)

## Related

- meltano#1606
- MeltanoLabs/tap-dbt#135
- PoC: reservoir-data/tap-bitly#494

## Summary by Sourcery

Introduce a dedicated HTTPRequest abstraction in the REST stream layer
and update tap-dummyjson to use it for request construction and
parameter handling.

New Features:
- Add an HTTPRequest dataclass for REST streams, including customizable
query parameter encoding and reusable request construction via
RESTStream.get_http_request.

Enhancements:
- Refactor RESTStream.prepare_request to build requests from HTTPRequest
instances and standardize URL parameter typing and encoding.
- Simplify DummyJSONAuthenticator to always set the Authorization header
after ensuring a valid token.
- Update tap-dummyjson client pagination to override get_http_request
instead of get_url_params for setting paging parameters.

Tests:
- Add a unit test covering custom HTTPRequest.encode_params behavior
with safe characters in query parameters.

## Summary by Sourcery

Introduce an HTTPRequest abstraction and context for RESTStream to
construct and customize HTTP requests, and migrate pagination and client
patterns to use it instead of get_url_params while deprecating
prepare_request overrides.

New Features:
- Add an HTTPRequest dataclass and HTTPRequestContext for representing
REST stream HTTP requests and their pagination/context.
- Expose RESTStream.get_http_request for building per-request URL,
headers, params, and payload from stream context and paginator state.

Enhancements:
- Refactor RESTStream request preparation to build PreparedRequest
objects from HTTPRequest instances with standardized payload typing and
parameter encoding.
- Update built-in taps (dummyjson, GitLab) and the cookiecutter tap
template to implement pagination by overriding get_http_request instead
of get_url_params.
- Improve paginator typing for RESTStream and BaseAPIPaginator
implementations.
- Emit deprecation warnings when prepare_request is overridden,
including when the override is in an intermediate base class.
- Adjust documentation examples to show customizing pagination by
modifying HTTPRequest rather than URL parameter dicts.

Documentation:
- Add reference stubs for HTTPRequest and HTTPRequestContext and update
pagination and incremental replication guides to document
get_http_request-based pagination patterns.

Tests:
- Add unit tests for HTTPRequest parameter encoding, including custom
safe characters and non-string parameter values.
- Extend REST pagination and metrics tests to cover the new
get_http_request usage and deprecation warnings for prepare_request
overrides.

---------

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@edgarrmondragon edgarrmondragon added the Deferred Delayed for a future version label Apr 24, 2026
Copy link
Copy Markdown
Collaborator

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll defer this. I don't see a very strong need for this at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community-Contributed PR Deferred Delayed for a future version SQL Support for SQL taps and targets Type/Target Singer targets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: New setting alias schema for builtin default_target_schema

2 participants