Skip to content

Commit

Permalink
Update parse on the column as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdunkerley committed Jan 7, 2025
1 parent 33e2c28 commit c600051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ type DB_Column
parse self type:(Value_Type | Auto) format:(Text | Data_Formatter)="" on_problems:Problem_Behavior=..Report_Warning =
if type == Auto then Error.throw (Unsupported_Database_Operation.Error "`Auto` parse type") else
if format != "" then Error.throw (Unsupported_Database_Operation.Error "Custom formatting") else
Value_Type.expect_text self <|
if self.value_type.is_same_type type then self else Value_Type.expect_text self <|
## In the future we may have some specific logic, for example
allowing to support formatting settings. For now, the
Database parse just boils down to a simple CAST.
Expand Down
2 changes: 1 addition & 1 deletion distribution/lib/Standard/Table/0.0.0-dev/src/Column.enso
Original file line number Diff line number Diff line change
Expand Up @@ -1835,7 +1835,7 @@ type Column
@format (make_format_chooser include_number=False)
parse : Value_Type | Auto -> Text | Data_Formatter -> Problem_Behavior -> Column
parse self type:(Value_Type | Auto)=Auto format:(Text | Data_Formatter)="" on_problems:Problem_Behavior=..Report_Warning =
Value_Type.expect_text self <|
if type != Auto && self.value_type.is_same_type type then self else Value_Type.expect_text self <|
formatter = case format of
_ : Text -> if format == "" then Data_Formatter.Value else Data_Formatter.Value.with_format type format
_ : Data_Formatter -> format
Expand Down

0 comments on commit c600051

Please sign in to comment.