Skip to content

chore: 100% test coverage for SQL parsing#33568

Merged
betodealmeida merged 1 commit intomasterfrom
sqlglot-tests
Jun 5, 2025
Merged

chore: 100% test coverage for SQL parsing#33568
betodealmeida merged 1 commit intomasterfrom
sqlglot-tests

Conversation

@betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented May 22, 2025

SUMMARY

Part of SIP-117, stacked on:

Adds 100% unit tests coverage to the superset/sql/ directory, and a CI rule to enforce it.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@korbit-ai
Copy link

korbit-ai bot commented May 22, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label May 22, 2025
@betodealmeida betodealmeida force-pushed the sqlglot-tests branch 2 times, most recently from 9307e30 to e151a54 Compare May 22, 2025 22:32
@betodealmeida betodealmeida force-pushed the remove-sql_parse branch 10 times, most recently from 094e4b9 to eefc631 Compare May 29, 2025 17:10
@betodealmeida betodealmeida force-pushed the sqlglot-tests branch 2 times, most recently from 9d654ac to b1830b2 Compare May 29, 2025 22:21
@betodealmeida betodealmeida marked this pull request as ready for review May 30, 2025 13:12
target = statements[-1]
for node in statements[-1].walk():
if hasattr(node, "comments"):
if hasattr(node, "comments"): # pragma: no cover
Copy link
Member Author

Choose a reason for hiding this comment

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

There were a couple lines that I couldn't hit with tests, but I thought it was safer to keep them, so I added the pragma.

rendered_template = Template(template).render(processor.get_context())
code = processor.env.compile(ast)
template = Template.from_code(processor.env, code, globals=processor.env.globals)
rendered_sql = template.render(processor.get_context())
Copy link
Member Author

Choose a reason for hiding this comment

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

Made sure to include the fix from #33596.

@michael-s-molina
Copy link
Member

oh_my_god

@betodealmeida betodealmeida force-pushed the remove-sql_parse branch 6 times, most recently from 4834814 to 1c2fee5 Compare June 4, 2025 18:32
@betodealmeida betodealmeida force-pushed the sqlglot-tests branch 2 times, most recently from 789c101 to 7be3f1b Compare June 4, 2025 21:58
@mistercrunch
Copy link
Member

chore: 100% test coverage for SQL parsing

next on my wish list -> chore: 100% test coverage for SQL GENERATION ❤️

Base automatically changed from remove-sql_parse to master June 4, 2025 23:31
@betodealmeida betodealmeida merged commit edc6091 into master Jun 5, 2025
53 of 54 checks passed
@betodealmeida betodealmeida deleted the sqlglot-tests branch June 5, 2025 02:18
ianngech pushed a commit to Pesapal-Ltd/superset that referenced this pull request Jun 10, 2025
LevisNgigi pushed a commit to LevisNgigi/superset that referenced this pull request Jun 18, 2025
@github-actions github-actions bot added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 6.0.0 First shipped in 6.0.0 labels Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels github_actions Pull requests that update GitHub Actions code preset-io size/XL 🚢 6.0.0 First shipped in 6.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants