Skip to content

pqtools 0.6.0 - a real query runs with no --bind

Choose a tag to compare

@GopalGB GopalGB released this 04 Sep 04:02
· 2 commits to master since this release

Local-file sources run natively now. Csv.Document, File.Contents and
Text.FromBinary are implemented in pqtools itself, in pure Python, with no
new dependencies - so a query copied verbatim out of Power Query's Advanced
Editor, Source step included, evaluates without anything supplied.

$ pq eval report.pq --format csv
Region,Total,Orders
West,380,2
North,150,1
East,100,1

Why this changed
The old boundary treated "connector" as one indivisible thing only
Microsoft's Mashup Engine could cross. That was too broad. Sql.Database
genuinely needs an engine. Reading a local CSV is reading a local CSV, and
Csv.Document(File.Contents(...)) is the most common Source step in real
Power Query - refusing it forced everyone through --bind for the one case
that needs no help.

Added

  • Csv.Document with the options-record and positional forms, multi-character
    and whitespace delimiters, QuoteStyle.None, CsvStyle.QuoteAlways,
    ExtraValues, named/typed/counted columns, and code-page decoding with a
    UTF-8 BOM strip. It does NOT promote headers - it yields Column1..ColumnN
    and Table.PromoteHeaders stays a separate step, exactly as Power Query
    does. Auto-promoting would break every real query.
  • File.Contents, Text.FromBinary.
  • Table.ReverseRows, Table.Repeat, Table.ExpandListColumn,
    Table.SelectRowsWithErrors, Table.ReplaceErrorValues - found by probing the
    115 functions the Power Query UI actually writes. 288 builtins total.
  • evaluate, EvalError and UnsupportedError are exported from the package
    root. "from pqtools import evaluate" is the import everyone guesses first
    and it did not work; a test now enforces that every import the README
    shows resolves.

Still refused, and now named individually rather than by the word
"connector": Sql.Database, Web.Contents, SharePoint., Odbc.,
Oracle/PostgreSQL/MySQL.Database, Folder.*, Excel.Workbook. Credentials, a
network identity, driver type mapping and query folding have no honest local
stand-in, and each raises a typed error naming itself.

Deliberately still unimplemented, with reasons rather than silence:
Table.FuzzyNestedJoin (Microsoft's matching algorithm is unspecified),
Table.View (query folding with no backing source), Table.Schema (no declared
column types exist in this data model), Table.Profile and
Table.AggregateTableColumn (output column names unverified).

646 tests, 89% coverage, mypy and ruff clean.