Flow PHP

InferredSchemaException extends InvalidArgumentException

FinalYes

Methods

because()  : self
columnsDiverge()  : self
filesDiverge()  : self
nothingToInferFrom()  : self
outsideTheSample()  : self
A file's record that does not fit a schema inferred from a sample - the sample can span files, so no position in this file places the record inside it.
unsupportedPath()  : self
whenPastTheSample()  : self|SchemaMismatchException
The refusal to raise for $mismatch, a row at its 0-based position in the whole source: past a bounded sample it becomes the way out, within the sample (or with no inference behind the schema) it stays the gate's own.

Methods

because()

public static because(string $format, float|int|string ...$parameters) : self
Parameters
$format : string
$parameters : float|int|string
Return values
self

columnsDiverge()

public static columnsDiverge(string $source, string $inferredFrom, array<int, string> $expected, array<int, string> $columns, int|null $sampleSize, int|null $filesToSniff) : self
Parameters
$source : string
$inferredFrom : string
$expected : array<int, string>
  • the column names of the inferred schema
$columns : array<int, string>
  • the columns the source actually carries - its header, duplicates already collapsed
$sampleSize : int|null
$filesToSniff : int|null
Return values
self

filesDiverge()

public static filesDiverge(string $source, string $readFrom, string $mismatches) : self
Parameters
$source : string
$readFrom : string
  • the file the extractor's schema was read from, the first one it listed
$mismatches : string
Return values
self

nothingToInferFrom()

public static nothingToInferFrom(string $source, string $reason) : self
Parameters
$source : string

the DSL call that built the source, e.g. 'from_parquet()'

$reason : string

why nothing was there, e.g. 'no row carries a column'

Return values
self

outsideTheSample()

A file's record that does not fit a schema inferred from a sample - the sample can span files, so no position in this file places the record inside it.

public static outsideTheSample(string $uri, int $offset, int|null $line, int|null $sampleSize, SchemaMismatchException $mismatch) : self
Parameters
$uri : string
$offset : int
$line : int|null
$sampleSize : int|null
$mismatch : SchemaMismatchException
Return values
self

unsupportedPath()

public static unsupportedPath(Filesystem $filesystem, Path $path, non-empty-string $dsl) : self
Parameters
$filesystem : Filesystem
$path : Path
$dsl : non-empty-string

the function or method the caller passes the filesystem to

Return values
self

whenPastTheSample()

The refusal to raise for $mismatch, a row at its 0-based position in the whole source: past a bounded sample it becomes the way out, within the sample (or with no inference behind the schema) it stays the gate's own.

public static whenPastTheSample(string $source, null|int $sampleSize, SchemaMismatchException $mismatch) : self|SchemaMismatchException
Parameters
$source : string
$sampleSize : null|int

the rows the schema was inferred from; null when there is no bound to outrun (a declared schema, or one inferred from every row)

$mismatch : SchemaMismatchException
Return values
self|SchemaMismatchException
On this page

Search results