Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CT-1169 add parsing of precision&scale to SNFLK #127

Merged
merged 10 commits into from
Feb 15, 2024

Conversation

tomasfejfar
Copy link
Collaborator

@tomasfejfar tomasfejfar commented Feb 6, 2024

@tomasfejfar tomasfejfar force-pushed the CT-1169-put-column-definition-endpoint branch from 0c4ad36 to 5e17c4d Compare February 7, 2024 09:02
@tomasfejfar tomasfejfar force-pushed the CT-1169-put-column-definition-endpoint branch 2 times, most recently from 36a2a6a to daaae47 Compare February 14, 2024 10:07
@tomasfejfar tomasfejfar requested a review from zajca February 14, 2024 15:24
Copy link
Member

@zajca zajca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vypadá to cajk.

  • přidal case kdy uděláš víc změn naráz
  • nebylo by od věci aby to mělo funkcionální test proti SNFLK

$parsed = array_map(intval(...), explode(',', $this->getLength()));
return ['numeric_precision' => $parsed[0], 'numeric_scale' => $parsed[1]];
}
return ['character_maximum' => $this->getLength()];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm co když si nadefinuju NUMERIC(10) bez precision? Opraví to v konstruktoru? Failne to v konstruktoru? Nebo to failne tady? Vlastně nevím :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je škoda žes k tomu není DTO ale dělá to array.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, doplním do testu

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined array key 1
 /var/www/html/vendor/symfony/phpunit-bridge/DeprecationErrorHandler.php:132
 /var/www/html/vendor/keboola/php-datatypes/src/Definition/Snowflake.php:213
 /var/www/html/vendor/keboola/php-datatypes/tests/SnowflakeDatatypeTest.php:393

🙈

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SNFLK to interně přeloží na NUMBER(10,0), ale to se sem nepropíše :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jestli to padá tady tak bych tam přidal 0 asi, otázka jaký to má case reálný pak. Jestli to može propadnůt ze SNFLK nebo ze Storage Api

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ze SNFLK ne. Tam když pošleš něco nekompletního, tak to vrací kompletní.

NUMBER(10) → NUMBER(10,0)
NUMBER → NUMBER(38,0)

Ze SAPI asi jo, pokud někde nastavujeme tyhle hodnoty z requestu a ne z backendu.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vyřšeno v 87bae6c

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jo to mě přijde v cajku

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho přes api by to přešlo tam sa spoléhá na validaci z tady toho Snowflake objektu

/**
* @return \Generator<string, array{Snowflake,Snowflake,string}>
*/
public function provideGetColumnDefinitionUpdate(): Generator
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chybý mě test co dělá víc věcí naráz

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vyřešeno v 15a44a4

@tomasfejfar tomasfejfar requested a review from zajca February 15, 2024 12:57
@tomasfejfar tomasfejfar force-pushed the CT-1169-put-column-definition-endpoint branch from 15a44a4 to f74d392 Compare February 15, 2024 13:21
@tomasfejfar tomasfejfar force-pushed the CT-1169-put-column-definition-endpoint branch from f74d392 to f3b83ba Compare February 15, 2024 15:02
@tomasfejfar tomasfejfar merged commit 1b4307e into main Feb 15, 2024
32 of 33 checks passed
@tomasfejfar tomasfejfar deleted the CT-1169-put-column-definition-endpoint branch February 15, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants