Skip to content

feat: Add Unit Tests for datatype.go #644

@vaibhav-datazip

Description

@vaibhav-datazip

Problem

The OLake codebase currently has unit tests for:

  • resolver
  • flattener
  • catalog

However, the file olake/utils/typeutils/datatype.go does not have any test coverage.

This file handles critical type detection and comparison logic:

  • TypeFromValue
  • MaximumOnDataType
  • detectTimestampPrecision
  • ExtractAndMapColumnType

Without unit tests, bugs in type detection, timestamp precision handling, or type comparisons may slip through during development.


Proposed Solution

Add comprehensive unit tests for the logic inside datatype.go.
This will help:

  • Increase overall test coverage
  • Improve type detection reliability
  • Catch bugs earlier during CI
  • Make contributions safer

For reference on how existing unit tests are structured, you can refer to PR #273.


Notes for Contributors

  • Add test covering most of the scenarios and edge cases which should indicate both pass and fail scenarios.
  • Follow the existing test file structure and naming conventions to maintain the consistency with other part.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions