typelevel / typelevel/skunk

roundtripTest for interval with precision is failing

Open
#261 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.7k
Forks
175
Avg merge
5d 14h
Merged PRs (30d)
9

Description

I wanted to increase the coverage for TemporalCodecs by adding a roundtripTest for every valid interval with precision codec.
However, it is failing with the following exception.

πŸ‹  tests.codec.TemporalCodecTest
   ? interval(0) (gmap) (Asserted and actual column types differ.)
   ? interval(0) (Asserted and actual column types differ.)

πŸ”₯  
πŸ”₯  ColumnAlignmentException
πŸ”₯  
πŸ”₯    Problem: Asserted and actual column types differ.
πŸ”₯       Hint: The decoder you provided is incompatible with the output columns for
πŸ”₯             this query. You may need to add or remove columns from the query or
πŸ”₯             your decoder, change their types, or add explicit SQL casts.
πŸ”₯  
πŸ”₯  The statement under consideration was defined
πŸ”₯    at /home/zsambek/dev/opensource/skunk/modules/tests/src/test/scala/codec/CodecTest.scala:35
πŸ”₯  
πŸ”₯    select $1::interval(0)
πŸ”₯  
πŸ”₯  The actual and asserted output columns are
πŸ”₯  
πŸ‹  tests.codec.TemporalCodecTest
   ? interval(0) (gmap) (Asserted and actual column types differ.)
πŸ”₯    interval  interval  ->  interval(0)  ── type mismatch
πŸ”₯  

skunk.exception.ColumnAlignmentException: Asserted and actual column types differ.

πŸ”₯  
πŸ”₯  ColumnAlignmentException
πŸ”₯  
πŸ”₯    Problem: Asserted and actual column types differ.
πŸ”₯       Hint: The decoder you provided is incompatible with the output columns for
πŸ”₯             this query. You may need to add or remove columns from the query or
πŸ”₯             your decoder, change their types, or add explicit SQL casts.
πŸ”₯  
πŸ”₯  The statement under consideration was defined
πŸ”₯    at /home/zsambek/dev/opensource/skunk/modules/tests/src/test/scala/codec/CodecTest.scala:35
πŸ”₯  
πŸ”₯    select $1::interval(0)
πŸ”₯  
πŸ”₯  The actual and asserted output columns are
πŸ”₯  
πŸ”₯    interval  interval  ->  interval(0)  ── type mismatch
Test suite aborted
πŸ”₯  
Test suite aborted

skunk.exception.ColumnAlignmentException: Asserted and actual column types differ.
Execution took -2ms

The test case for this one was: roundtripTest(interval(0))(intervals: _*)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing TemporalCodecTest case, roundtripTest(interval(0))(intervals: _*), and the statement location in modules/tests/src/test/scala/codec/CodecTest.scala. Run the test and compare the asserted interval(0) column type with the actual interval type. Done means the precision interval roundtrip test passes without a ColumnAlignmentException.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgres, scala
Domain
database, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.