-
Notifications
You must be signed in to change notification settings - Fork 327
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
Expand and improve pretty
for core data types, vector and table.
#11438
Conversation
Add widgets for `Date` and `Time_Of_Day`.
Add for Column and Table.
Remove unneeded brackets.
Date_Range.pretty fix.
Fix `Date_Range.pretty`. Tests for pretty on `Period` and `Date_Range`,
Tests for `Date_Time.pretty`.
Test for `Vector.pretty`.
distribution/lib/Standard/Base/0.0.0-dev/src/Enso_Cloud/Enso_Secret.enso
Outdated
Show resolved
Hide resolved
…ecret.enso Co-authored-by: Radosław Waśko <[email protected]>
group_builder.specify "should convert to Enso code" <| | ||
create_new_datetime 1970 . pretty . should_equal "Date_Time.new 1970 1 1" | ||
create_new_datetime 1923 9 24 . pretty . should_equal "Date_Time.new 1923 9 24" | ||
create_new_datetime 1923 9 24 12 20 44 . pretty . should_equal "Date_Time.new 1923 9 24 12 20 44" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd appreciate a test where hours and minutes are 0, so that we get the seconds=
from Standard.Base.Network.HTTP import _resolve_headers, get_follow_redirects, get_proxy, get_timeout, get_version | ||
from Standard.Base.Network.HTTP import _resolve_headers, _get_follow_redirects, _get_proxy, _get_timeout, _get_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't the convention for _
was to indicate module private methods?
Not opposed to using _
for 'internal method that is exported for test purposes', just making sure we have a clear guideline on the naming.
Also, I guess if we want to do this proper, we could mark these methods as private
and move these few test cases into Base_Internal_Tests
that can load private modules.
But ofc happy to proceed as-is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hoping we will get tests inside the same project soon and then these would be properly private.
Debug.eval c1.pretty . should_equal c1 | ||
|
||
c2 = Column.from_vector "X" ["a", 42] | ||
c2.pretty . should_equal 'Column.from_vector \'X\' [\'a\', 42]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor nitpick, but wouldn't this test be more easily readable with "
?
c2.pretty . should_equal 'Column.from_vector \'X\' [\'a\', 42]' | |
c2.pretty . should_equal "Column.from_vector 'X' ['a', 42]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great overall, just some minor suggestions
Pull Request Description
Any.pretty
so constructor is prefixed with type name (as needed now).pretty
onDate
.pretty
for ✅Date_Time
and ✅Time_Of_Day
improved to not have as much noise.pretty
for ✅Period
, ✅Date_Range
and ✅Range
.pretty
for ✅Vector
and ✅Array
as built-in method doesn't call through to overrides.pretty
for ✅Column
and ✅Table
.pretty
inTime_Zone
so calls through topretty
of the zone_id to ensure safely escaped.default_widget
forDate
andTime_Of_Day
.Date.to_date_time
.to_text
,to_display_text
andpretty
forEnso_Secret
Enso_Secret
as can't be correctly built directly._
for the testing methods inHTTP
to clarify they shouldn't be used in general code.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
TypeScript,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
or the Snowflake database integration, a run of the Extra Tests has been scheduled.