Commit b9d48fa
authored
Fix type checking failure with Python 3.10+ union pipe syntax (int | None) (#37645)
* Fix type checking failure with Python 3.10+ union pipe syntax (int | None)
The normalize() function did not handle types.UnionType, causing
is_consistent_with() to fall through to issubclass() with a non-class
argument. Route types.UnionType through convert_to_beam_type() which
already knows how to convert it to Beam's UnionConstraint.
Fixes #36592
* Fix yapf formatting in test file
* Address review: merge UnionType check into existing elif, remove issue link comments1 parent 872c671 commit b9d48fa
2 files changed
Lines changed: 28 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
1468 | 1469 | | |
1469 | 1470 | | |
1470 | 1471 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1596 | 1596 | | |
1597 | 1597 | | |
1598 | 1598 | | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1599 | 1615 | | |
1600 | 1616 | | |
1601 | 1617 | | |
| |||
1934 | 1950 | | |
1935 | 1951 | | |
1936 | 1952 | | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
1937 | 1961 | | |
1938 | 1962 | | |
1939 | 1963 | | |
| |||
0 commit comments