Skip to content

Commit

Permalink
Added missing tests for parquet rows normalizer (#1054)
Browse files Browse the repository at this point in the history
  • Loading branch information
norberttech authored Apr 24, 2024
1 parent 03625a2 commit 965269c
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Flow\ETL\Adapter\Parquet\Tests\Unit;

use function Flow\ETL\DSL\{row, rows, schema, str_entry, str_schema};
use Flow\ETL\Adapter\Parquet\RowsNormalizer;
use Flow\ETL\Exception\CastingException;
use Flow\ETL\PHP\Type\Caster;
use PHPUnit\Framework\TestCase;

final class RowsNormalizerTest extends TestCase
{
public function test_casting_error() : void
{
$this->expectException(CastingException::class);
$this->expectExceptionMessage("Can't cast \"NULL\" into \"string\" type");

$rows = rows(row(str_entry('id', null)));
$schema = schema(str_schema('id', nullable: false));

(new RowsNormalizer(Caster::default()))->normalize($rows, $schema);
}
}

0 comments on commit 965269c

Please sign in to comment.