NAME

  [1mtdda diff [22mâ compare csv or parquet files

SYNOPSIS

  [1mtdda diff [22m[[1m‐‐fields [4m[22mFIELD1,FIELD2[24m,...]
              [[1m‐‐xfields [4m[22mFIELD1,FIELD2[24m,...  ]
              [[1m‐‐horizontal[22m] [[1m‐H[22m] [[1m‐‐vertical[22m] [[1m‐V[22m]
              [[1m‐‐find‐md[22m] [[1m‐‐no‐md[22m]
              [[1m‐‐maxdiffs [4m[22mN[24m] [[1m‐‐key [4m[22mFIELD[24m]
              [[1m‐‐mono[22m] [[1m‐‐bw[22m] [[1m‐‐colours [4m[22mCOLOURS[24m] [[1m‐c [4m[22mCOLOURS[24m]
              [[1m‐‐dps [4m[22mN[24m]  [[1m‐‐precision [4m[22mN[24m]
              [[1m‐‐AE[22m] [[1m‐‐LR[22m] [[1m‐‐angles[22m] [[1m‐‐pm[22m]
              [[1m‐‐prefixes [4m[22mPREFIXES[24m]
              [[1m‐N[22m] [[1m‐‐no‐config[22m]
              [[1m‐‐strict[22m] [[1m‐‐medium[22m] [[1m‐‐loose[22m] [[1m‐‐permissive[22m]
              [4mLEFT[24m [4mRIGHT[0m

POSITIONAL ARGUMENTS

  [4mLEFT[24m The first dataset to be compared, as a parquet or flat file
         (e.g. CSV), optionally using [1m: [22mformat to specify flat‐file metadata
         (see the help for [1mtdda serial[22m).
         (Normally thought of as left or actual)

  [4mRIGHT[24m The second dataset to be compared as a parquet or flat file
          (e.g. CSV), optionally using [1m: [22mformat to specify flat‐file metadata
          (see the help for [1mtdda serial[22m).
          (Normally thought of as right, expected, reference, etc.)

DESCRIPTION

  The [1mtdda diff [22mcommand compares two tabular datasets in CSV or Parquet
  files and shows some or all differences. It uses the same underlying
  functionality as the [1mtdda.referencetest [22massertions such as
  [1massertDataFramesEqual[22m, and provides similar control over what
  differences to consider, e.g. which fields, and strictness of type and
  numeric comparisons. It also provides a number of options for controlling
  the display of differences.

  By default, comparisons are row‐based and consider all fields (columns),
  as typed values after reading.

OPTIONS

  [1m* [22mindicates options that are the default behaviours

  [1m‐‐fields [4m[22mFIELD1,FIELD2[24m,...
    Check only these fields (comma‐separated list)

  [1m‐‐xfields [4m[22mFIELD1,FIELD2[24m,...
    Check all fields except these (comma‐separated list)

  [1m‐‐horizontal[22m, [1m‐H[0m
    Horizontal display (left and right, side by side)

  [1m‐‐vertical[22m, [1m‐V[0m
    Vertical display (left above right)

  [1m‐‐find‐md[0m
    Attempt to find associated metadata for flat files.

  [1m‐‐no‐md[22m, [1m‐‐no‐find‐md[0m
    Do not attempt to find associated metadata for flat files.

  [1m‐‐key [4m[22mFIELD[0m
    Use this field as a join key when reporting differences.

  [1m‐‐maxdiffs [4m[22mN[0m
    Maximum number of differences to show.

  [1m‐‐mono[0m
    Show monochrome output with different values in bold
    and shared values dimmed.

  [1m‐‐bw[0m
    Show black and white output with different values in bold and shared
    values in the terminal’s default style.

  [1m‐‐colours [4m[22mCOLOURS[24m, [1m‐c [4m[22mCOLOURS[0m
    Use colours specified e.g. [1m‐c red‐blue[0m

  [1m‐‐dps [4m[22mN[0m
    Number of decimal places to show for floating‐point values.
    Also sets precision if not specified separately.

  [1m‐‐precision [4m[22mN[0m
    Precision for floating point comparisons. Two floats [1ma [22mand [1mb [22mwill be
    considered equal if [1mabs(a ‐ b) < 1e‐[4m[22mN[24m.

  [1m‐‐AE[0m
    Use [1mA: [22mand [1mE: [22mas labels for the two datasets (actual/expected)

  [1m‐‐LR[0m
    Use [1mL: [22mand [1mR: [22mas labels for the two datasets (left/right)

  [1m‐‐angles[0m
    Use [1m< [22mand [1m> [22mas labels for the two datasets

  [1m‐‐pm[0m
    Use [1m+ [22mand [1m‐ [22mas labels for the two datasets

  [1m‐‐prefixes [4m[22mPREFIXES[0m
    Use prefixes specified as labels for the two datasets
    e.g. [1m‐‐prefixes "actual:‐ref:" [22mor [1m"actual: ‐ref: " [22mto include spaces

  [1m‐N[22m, [1m‐‐no‐config[0m
    Use default configuration (ignore [1m˜/.tdda.toml[22m)

  [1m‐‐strict[0m
    Use strict type comparisons

  [1m‐‐medium[0m
    Use medium‐strictness type comparisons

  [1m‐‐loose[0m
    Use loose (permissive) type comparisons

  [1m‐‐permissive[0m
    Use loose (permissive) type comparisons

  [1m‐‐pandas[22m, [1m‐‐pd          [22mUse Pandas as DataFrame engine. *
  [1m‐‐polars[22m, [1m‐‐pl          [22mUse Polars as DataFrame engine.
  [1m‐‐backend[22m, [1m‐B [4m[22mBACKEND[24m   Backend choice for Pandas
                          (when dataframe engine is Pandas)
                              [1mn [22mfor numpy_nullable *
                              [1ma [22mfor pyarrow
                              [1mo [22mfor original.

  [1m‐‐help[22m, [1m‐?[22m, [1m‐‐?[0m
    Show help on [1mtdda diff[22m.

EXAMPLES

  Data suitable for all examples can be obtained with

  [1mtdda examples diff[0m

  1) [1mtdda diff a.csv a.csv[0m

  This is the simplest form of the command. It will read [1ma.csv [22mand
  convert it to a data frame, using the default back end (Pandas).

  2) [1mtdda diff a.csv b.csv ‐‐vertical[0m

  Compare two CSV files, stacking left and right values vertically
  rather than side by side. Useful when there are many columns or
  long values.

  3) [1mtdda diff before.parquet after.parquet ‐‐key Income,Expenditure[0m

  Compare two Parquet files using a composite join key. The fields
  [1mIncome [22mand [1mExpenditure [22mmust form a primary key in both datasets.
  Rows are matched by key rather than by position.

  4) [1mtdda diff actual.csv expected.csv ‐‐AE ‐‐bw[0m

  Compare two CSV files using [1mA: [22mand [1mE: [22mas markers for actual and
  expected, with monochrome bold highlighting instead of colour.

  5) [1mtdda diff foo.csv: bar.csv:[0m

  Compare two CSV files, asking TDDA to find associated metadata files
  for each using naming conventions (e.g. [1m@.serial [22mor
  [1mfoo‐metadata.json [22min the same directory).

  6) [1mtdda diff foo.csv bar.txt:money.serial[0m

  Compare [1mfoo.csv [22m(loaded with default settings) against [1mbar.txt[22m,
  using [1mmoney.serial [22mas the metadata file describing its format.

  7) [1mtdda diff a.parquet b.csv ‐‐loose ‐‐dps 3[0m

  Compare a Parquet file against a CSV file with loose type matching
  and floating‐point values compared to 3 decimal places.






















