Skip to content

[MAINTENANCE] Fix schema_name deprecation warning#11849

Open
tyler-hoffman wants to merge 5 commits into
developfrom
m/GX-3216/bad-deprecation-warning
Open

[MAINTENANCE] Fix schema_name deprecation warning#11849
tyler-hoffman wants to merge 5 commits into
developfrom
m/GX-3216/bad-deprecation-warning

Conversation

@tyler-hoffman
Copy link
Copy Markdown
Contributor

Resolves GX-3216.

Summary of changes:

  • Don't alert on None schema_name
  • Put asset name in deprecation warning in make things less ambiguious
  • Remove
  • Description of PR changes above includes a link to an existing GitHub issue
  • PR title is prefixed with one of: [BUGFIX], [FEATURE], [DOCS], [MAINTENANCE], [CONTRIB], [MINORBUMP]
  • Code is linted - run invoke lint (uses ruff format + ruff check)
  • Appropriate tests and docs have been updated

For more information about contributing, visit our community resources.

After you submit your PR, keep the page open and monitor the statuses of the various checks made by our continuous integration process at the bottom of the page. Please fix any issues that come up and reach out on Slack if you need help. Thanks for contributing!

Copilot AI review requested due to automatic review settings April 22, 2026 14:44
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 75fb9d1
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/69e8e091a31e680008947712

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts how TableAsset.schema_name deprecation warnings are emitted so existing configs that deserialize schema_name: null don’t trigger warnings, while making the warning message more actionable by including the asset name. It also removes now-unnecessary pytest warning filters and adds targeted tests to lock in the behavior.

Changes:

  • Update TableAsset’s schema_name validator to skip warnings for None/missing values and include the asset name in the warning text.
  • Add unit tests validating when the deprecation warning should (and should not) fire, and that it includes the asset name.
  • Remove pytest filterwarnings entries that previously masked schema_name deprecation warnings.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/datasource/fluent/test_sql_datasources.py Adds tests for schema_name deprecation warning behavior and message content.
pyproject.toml Removes pytest warning filters for deprecated schema_name warnings.
great_expectations/datasource/fluent/sql_datasource.py Changes schema_name deprecation warning logic and message to avoid warning on None and include asset name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

deprecation_warnings = [
w
for w in caught
if issubclass(w.category, DeprecationWarning) and "schema_name" in str(w.message)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This list-comprehension line exceeds the repo's Ruff line-length = 100 and will likely fail the ruff check (E501). Please reformat/wrap the comprehension (or split the predicate) so the line length stays within 100 characters.

Suggested change
if issubclass(w.category, DeprecationWarning) and "schema_name" in str(w.message)
if (
issubclass(w.category, DeprecationWarning)
and "schema_name" in str(w.message)
)

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.73%. Comparing base (c38a994) to head (75fb9d1).
⚠️ Report is 21 commits behind head on develop.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11849      +/-   ##
===========================================
- Coverage    84.74%   84.73%   -0.01%     
===========================================
  Files          471      471              
  Lines        39160    39161       +1     
===========================================
- Hits         33185    33184       -1     
- Misses        5975     5977       +2     
Flag Coverage Δ
3.10 73.58% <100.00%> (+<0.01%) ⬆️
3.10 athena ?
3.10 aws_deps ?
3.10 big ?
3.10 clickhouse ?
3.10 filesystem ?
3.10 mysql ?
3.10 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.10 postgresql ?
3.10 singlestore ?
3.10 spark_connect ?
3.10 sql_server ?
3.10 trino ?
3.11 73.61% <100.00%> (-0.01%) ⬇️
3.11 athena ?
3.11 aws_deps ?
3.11 big ?
3.11 clickhouse ?
3.11 filesystem ?
3.11 mysql ?
3.11 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.11 postgresql ?
3.11 singlestore ?
3.11 spark_connect ?
3.11 sql_server ?
3.11 trino ?
3.12 73.63% <100.00%> (+<0.01%) ⬆️
3.12 athena ?
3.12 aws_deps ?
3.12 big ?
3.12 filesystem ?
3.12 mysql ?
3.12 openpyxl or pyarrow or project or sqlite or aws_creds ?
3.12 postgresql ?
3.12 singlestore ?
3.12 spark_connect ?
3.12 sql_server ?
3.13 73.63% <100.00%> (+<0.01%) ⬆️
3.13 athena 41.86% <25.00%> (-0.01%) ⬇️
3.13 aws_deps 45.12% <25.00%> (-0.01%) ⬇️
3.13 big 55.20% <75.00%> (-0.01%) ⬇️
3.13 bigquery 51.20% <75.00%> (-0.01%) ⬇️
3.13 clickhouse 41.87% <25.00%> (-0.01%) ⬇️
3.13 databricks 53.01% <75.00%> (-0.01%) ⬇️
3.13 filesystem 64.31% <75.00%> (-0.01%) ⬇️
3.13 gx-redshift 51.35% <75.00%> (-0.01%) ⬇️
3.13 mysql 51.74% <75.00%> (-0.01%) ⬇️
3.13 openpyxl or pyarrow or project or sqlite or aws_creds 59.90% <75.00%> (-0.02%) ⬇️
3.13 postgresql 55.16% <75.00%> (-0.01%) ⬇️
3.13 singlestore 47.02% <75.00%> (-0.01%) ⬇️
3.13 snowflake 53.85% <75.00%> (+<0.01%) ⬆️
3.13 spark 55.89% <25.00%> (-0.01%) ⬇️
3.13 spark_connect 46.79% <25.00%> (-0.01%) ⬇️
3.13 sql_server 53.14% <75.00%> (-0.04%) ⬇️
3.13 trino 48.66% <75.00%> (-0.02%) ⬇️
cloud 0.00% <0.00%> (ø)
docs-basic 59.45% <75.00%> (-0.01%) ⬇️
docs-creds-needed 58.06% <75.00%> (-0.02%) ⬇️
docs-spark 57.50% <75.00%> (-0.01%) ⬇️

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tyler-hoffman tyler-hoffman changed the title Fix schema_name deprecation warning ignores of deprecation warning [BUGFIX] Fix schema_name deprecation warning ignores of deprecation warning Apr 22, 2026
@tyler-hoffman tyler-hoffman changed the title [BUGFIX] Fix schema_name deprecation warning ignores of deprecation warning [MAINTENANCE] Fix schema_name deprecation warning ignores of deprecation warning Apr 22, 2026
@tyler-hoffman tyler-hoffman changed the title [MAINTENANCE] Fix schema_name deprecation warning ignores of deprecation warning [MAINTENANCE] Fix schema_name deprecation warning Apr 22, 2026
def _schema_name_deprecation_warning(
cls, v: str | Missing | None, values: dict
) -> str | Missing | None:
if v is MISSING or v is None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If v is None, that means the user passed schema_name=None right? We don't want that, because eventually we will remove schema_name and break them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It means that OR - and this is what Don was hitting in the ticket I believe - we hit this when loading data from the server. But I guess you're right that we probably do want to keep warning if users pass it.. maybe I should just move this to make mercury filter out that field

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see. It sounds like mercury "cleanup" needs to happen. Even if he was using an old asset, I wouldn't expect to see the warning.

Comment thread pyproject.toml
"once:Passing a string to the row_condition parameter is deprecated:DeprecationWarning",
# Existing cloud configs store "schema_name": null. During deserialization, Pydantic passes
# None to the validator which triggers the deprecation warning. The TableAsset.dict() override
# strips schema_name from new serializations, so these will clean up over time.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like these got cleaned up from our cloud org! I think cloud-tests was failing and that's why I added this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants