Infer exact rows for #table expressions - #286
Merged
Merged
Conversation
added 3 commits
August 18, 2026 14:21
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9839e176-efce-4a70-811b-7e2668cdb7f3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9839e176-efce-4a70-811b-7e2668cdb7f3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9839e176-efce-4a70-811b-7e2668cdb7f3
This was referenced Aug 18, 2026
added 2 commits
August 18, 2026 14:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9839e176-efce-4a70-811b-7e2668cdb7f3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9839e176-efce-4a70-811b-7e2668cdb7f3
Migrate #table row inference to the intrinsic dispatcher and the released parser 1.0.0 defined-table contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Limit this PR to retaining exact row values without inferring or widening list-form column schemas from their contents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Use one schema, row extraction, validation, and factory path for both explicit and list-form #table constructors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Cover nullable schemas, generalized and heterogeneous values, zero-column rows, out-of-range access, multi-row projection, and additional malformed row shapes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Union closed table schemas, normalize missing cells to null, concatenate exact rows within the shared retention limit, and preserve conservative fallbacks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Use existing type guards for dispatch and combine ordered table fields in one pass while preserving exact concatenation behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Preserve the existing examples that explain primitive, defined, and mixed record/table concatenation branches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Separate record opening and field merging from exact table concatenation while preserving the existing branch comments. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
JordanBoltonMN
approved these changes
Aug 26, 2026
JordanBoltonMN
requested changes
Aug 27, 2026
Alex Vallone (amv146)
marked this pull request as ready for review
August 27, 2026 17:50
added 6 commits
August 27, 2026 10:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
JordanBoltonMN
approved these changes
Aug 27, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 946bd35e-0c84-49f0-90ff-a15d522d34f8
JordanBoltonMN
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PQLS already inferred a schema for static
#tablecalls, but it discarded literal row values. As a result, later operations such as numeric item access, field projection, and table concatenation could not use row data that was known at inspection time.This PR retains exact rows when it is safe to do so and keeps a schema-only table when the schema is known but the rows are not.
Behavior
#table({"Name"}, {{"Betty"}})DefinedTablewithName: Anyand the exact row#table(type table [Name = text], rows)with dynamicrowsDefinedTablewithName: textDefinedTabletableList-form columns continue to use
Any; row contents do not infer or widen column types. Explicittype table [...]schemas retain their declared field types, and exact rows are kept only when their values are compatible with those declarations.Downstream operations
None, or returns a record derived from the known schema when rows are unavailable.Anyand exact rows are dropped.null. Exact rows are retained only when both operands have them and the combined total is at most 100 rows; otherwise the combined schema is preserved without rows.table.For example:
produces a schema equivalent to
[A = nullable number, B = nullable text]and exact rows equivalent to{[A = 1, B = null], [A = null, B = "two"]}.Non-goals
Inferring column types from list-form row contents is intentionally deferred to a follow-up change.
Dependency
This uses
@microsoft/powerquery-parser@2.0.0, whereDefinedTable.rowsis optional: omitted rows mean "schema known, rows unknown," while[]means an exact empty table.Validation
npm ci --registry https://registry.npmjs.orgnpm run buildnpm run lintnpm test(776 passing)