Skip to content

Add nested param to get_sample_data and API compatibility tests to prevent connector signature mismatches #4202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

agl29
Copy link
Collaborator

@agl29 agl29 commented Jul 23, 2025

  • Add source code parsing test to validate connector method signatures
  • Add base API contract validation to ensure consistent signatures
  • Prevent runtime TypeError when adding parameters like 'nested' to get_sample_data()

What changes were proposed in this pull request?

  • Added source code parsing tests to validate that all connector method signatures remain consistent with the base API contract
  • Implemented base API contract validation to ensure method signatures across 11+ connectors (Trino, MySQL, PostgreSQL, Oracle, SQLite, Flink SQL, JDBC variants, etc.) stay synchronized
  • Added parameter compatibility checks to prevent runtime TypeErrors when new parameters (like 'nested') are added to base API methods

How was this patch tested?

  • Unit tests: Added comprehensive source code parsing tests that validate method signatures across all connector implementations
  • Manual testing

Copy link

github-actions bot commented Jul 23, 2025

✅ Test files were modified. Ensure that the tests cover all relevant changes. ✅

Copy link

github-actions bot commented Jul 23, 2025

UI Code Coverage Report

Lines Statements Branches Functions
Coverage: 33%
39.45% (30815/78093) 31.18% (14346/46005) 24.74% (2215/8953)

Copy link

github-actions bot commented Jul 23, 2025

Coverage

Backend Code Coverage Report •
FileStmtsMissCoverMissing
desktop/libs/librdbms/src/librdbms/server
   dbms.py651183%34, 37, 39, 41, 43, 48–49, 51, 94, 100, 103
   sqlite_lib.py611083%25–27, 78, 89–90, 102, 106–108
desktop/libs/notebook/src/notebook/connectors
   base.py43121151%56, 61, 76, 159, 161, 173, 175, 178, 180, 191, 193, 196, 198, 208, 210, 213, 215, 227, 229, 233, 235–242, 244, 258, 260, 263, 279, 281–282, 290, 292–294, 296, 307, 340, 348, 350, 360, 368, 376, 384, 394, 405–408, 410–411, 413, 422, 425, 433–434, 436–437, 446–447, 458–490, 492–528, 530, 534–536, 538, 552, 559, 562, 568, 585, 588, 591, 594, 597, 600, 607, 610, 613, 616–617, 619–620, 622, 625–626, 628, 630, 633–634, 636, 638, 641–644, 657–658, 660, 668–670, 673, 676–679, 682, 689–692, 697, 703, 725, 733, 741–744, 746–753, 755–756, 758–765
   flink_sql.py32819739%44–53, 59–60, 62–65, 112–114, 116–120, 122, 125, 131–132, 134–135, 138–139, 141, 143–144, 146–147, 149, 152–153, 155–158, 160, 169–172, 174, 188, 193–194, 196, 200–201, 203, 209, 213–214, 216, 218–222, 224–238, 240–242, 244, 246–247, 251–252, 254, 257, 259–260, 262, 264, 268, 270–271, 273, 275, 277, 279, 302–309, 322–323, 325, 330–333, 335–338, 340–341, 343–350, 352, 372–373, 375–379, 381, 385–386, 388–390, 393–396, 398, 400, 403–405, 407, 416, 422–423, 425–426, 428, 431–432, 434, 436, 438, 447–448, 450, 453, 455, 487, 494, 504–507, 510, 513, 516, 519–520, 523, 526, 529, 532, 535, 537–538, 541, 544, 546–547, 550, 558, 566, 574
   spark_shell.py50319461%42–43, 77, 119–120, 147–149, 152–153, 173–175, 177, 189, 208, 213–215, 217, 219, 223–224, 226, 229–234, 236, 238, 240–242, 244–255, 257–259, 261–264, 266, 272–274, 276–277, 279–281, 283, 324–325, 327–329, 331–334, 336, 338, 340, 343–344, 346, 348–352, 354, 357–359, 361–366, 368, 371–374, 376, 378, 381, 384, 386–389, 393–395, 397–399, 401, 404, 406–407, 409, 412, 415, 419–420, 422–424, 426, 428–435, 443, 449–450, 452, 454–458, 460–463, 465, 468, 470–474, 476–477, 480–481, 483–484, 487–488, 490–491, 493–494, 497–498, 500–501, 503–506, 508–509, 511–512, 518, 531, 535, 558, 583, 615, 646–647, 679, 769, 775, 794, 798, 832–834
   sql_alchemy.py3379571%83–86, 88–96, 98–99, 166, 175, 182, 202–204, 206, 212–214, 216, 234, 289, 294–298, 315, 321, 327–341, 353, 367, 369, 371, 373, 375, 381, 385, 396, 398–404, 406, 409–410, 421, 423, 452–454, 525, 528, 531–534, 537, 542–543, 546–547, 549–550, 562–565, 567, 573–575
   trino.py29710464%46–55, 124, 134–135, 137–140, 142, 201, 206, 208, 231–232, 239–240, 307, 326–328, 330–333, 335, 337, 340, 360–363, 365, 369–375, 385–391, 393, 428, 430–431, 433–434, 440–441, 444–446, 448–449, 451–452, 454–455, 457–460, 462, 465–466, 468–471, 473–482, 484–485, 487–495
TOTAL547382739849% 

…event connector signature mismatches

- Add source code parsing test to validate connector method signatures
- Add base API contract validation to ensure consistent signatures
- Prevent runtime TypeError when adding parameters like 'nested' to get_sample_data()
Copy link
Collaborator

@Harshg999 Harshg999 left a comment

Choose a reason for hiding this comment

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

LGTM!

@agl29 agl29 requested a review from ramprasadagarwal July 23, 2025 16:24
@agl29 agl29 merged commit 2445dde into master Jul 24, 2025
9 checks passed
@agl29 agl29 deleted the nested_param branch July 24, 2025 16:18
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