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

Execution control for Table.write and various widget tweaks... #6835

Merged
merged 25 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5c8b3b3
Restructure `Text.write` and reuse components to control `Table.write`.
jdunkerley May 22, 2023
f351e91
Add dropdown for `aggregate`.
jdunkerley May 23, 2023
68e1584
Add ALIAS for reading sheets and ranges.
jdunkerley May 24, 2023
a34a879
Fix issue where `tables` didn't allow a single value.
jdunkerley May 24, 2023
bc8d25a
Fix not returning the File.
jdunkerley May 24, 2023
86d959b
Fix not returning the File.
jdunkerley May 24, 2023
06eb761
Simplify docs a bit.
jdunkerley May 25, 2023
b0a60c5
Fix for find_all.
jdunkerley May 30, 2023
2c49cb3
Add some ALIASes (+, -, few methods).
jdunkerley May 30, 2023
73b6c86
ALIASes for `*` and `/`.
jdunkerley May 30, 2023
c451310
Add all the other ALIASes for operators.
jdunkerley May 30, 2023
efd3d6a
Remove legacy default_widget for Filter_Condition.
jdunkerley May 31, 2023
8ecc91d
Use fully qualified name for Locale dropdowns.
jdunkerley May 31, 2023
eb4a6ea
Adding decode to Response and Response_Body.
jdunkerley May 31, 2023
8351227
Align find_all with C#/python approach.
jdunkerley Jun 1, 2023
c38e6b7
Remove context imports which aren't used.
jdunkerley Jun 1, 2023
5edd3b2
CHANGELOG.
jdunkerley Jun 1, 2023
f4496da
Fix Formats test.
jdunkerley Jun 1, 2023
fc87eeb
Add Modulo alias.
jdunkerley Jun 1, 2023
7b377dc
Use Java Optional for Content-Type.
jdunkerley Jun 1, 2023
9c9b51b
Rename to types_vector.
jdunkerley Jun 1, 2023
5aa8a8c
Fix issues with decode.
jdunkerley Jun 1, 2023
7a9947c
Fix issues with format types and fetch methods.
jdunkerley Jun 1, 2023
ad897c8
Better `on` for `join`.
jdunkerley Jun 1, 2023
85ac034
Fix failed test.
jdunkerley Jun 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@
- [Implemented the `cast` operation for `Table` and `Column`.][6711]
- [Added `.round` and `.int` to `Integer` and `Decimal`.][6743]
- [Added `.round`, `.truncate`, `.ceil`, and `.floor` to `Column`.][6817]
- [Added execution control to `Table.write` and various bug fixes.][6835]

[debug-shortcuts]:
https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug
Expand Down Expand Up @@ -684,6 +685,7 @@
[6711]: https://github.com/enso-org/enso/pull/6711
[6743]: https://github.com/enso-org/enso/pull/6743
[6817]: https://github.com/enso-org/enso/pull/6817
[6835]: https://github.com/enso-org/enso/pull/6835

#### Enso Compiler

Expand Down
10 changes: 2 additions & 8 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Any.enso
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ type Any
to_display_text : Text
to_display_text self = @Builtin_Method "Any.to_display_text"

## ALIAS Equality

## ALIAS Equals
Checks if `self` is equal to `that`.

Arguments:
Expand Down Expand Up @@ -110,8 +109,7 @@ type Any
== : Any -> Boolean
== self that = @Builtin_Method "Any.=="

## ALIAS Inequality

## ALIAS Not Equals
Checks if `self` is not equal to `that`.

Arguments:
Expand All @@ -134,7 +132,6 @@ type Any
!= self that = (self == that).not

## ALIAS Greater Than

Checks if `self` is greater than `that`.

Arguments:
Expand Down Expand Up @@ -162,7 +159,6 @@ type Any
_ -> False

## ALIAS Greater Than or Equal

Checks if `self` is greater than or equal to `that`.

Arguments:
Expand Down Expand Up @@ -192,7 +188,6 @@ type Any
_ -> False

## ALIAS Less Than

Checks if `self` is less than `that`.

Arguments:
Expand Down Expand Up @@ -220,7 +215,6 @@ type Any
_ -> False

## ALIAS Less Than or Equal

Checks if `self` is less than or equal to `that`.

Arguments:
Expand Down
30 changes: 20 additions & 10 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Data.enso
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ list_directory : (File | Text) -> Text -> Boolean -> Vector File
list_directory directory name_filter=Nothing recursive=False =
File.new directory . list name_filter=name_filter recursive=recursive

## Fetches from the provided URL and returns the response body.
Will error if the status code does not represent a successful response.
## ALIAS Download, HTTP Get
Fetches from the provided URI and returns the response, parsing the body if
the content-type is recognised. Returns an error if the status code does not
represent a successful response.

Arguments:
- url: The URL to fetch.
- uri: The URI to fetch.
- method: The HTTP method to use. Defaults to `GET`.
- headers: The headers to send with the request. Defaults to an empty vector.
- parse: If successful should the body be parsed to an Enso native object.
Expand All @@ -159,10 +161,18 @@ fetch uri method=HTTP_Method.Get headers=[] parse=True =
request = Request.new method uri parsed_headers
response = HTTP.new.request request

if response.code.is_success.not then Error.throw (Request_Error.Error "Status Code" ("Request failed with status code: " + response.code.to_text + ". " + response.body.to_text)) else
response_headers = response.headers
content_type = response_headers.find if_missing=Nothing h-> "Content-Type".equals_ignore_case h.name
if (parse == False) || (content_type == Nothing) then response else
format = Auto_Detect.get_web_parser content_type.value uri
if format == Nothing then response else
format.read_web response
if response.code.is_success.not then Error.throw (Request_Error.Error "Status Code" ("Request failed with status code: " + response.code.to_text + ". " + response.body.decode_as_text)) else
if parse then response.decode if_unsupported=response else response

## ALIAS Download, HTTP Get
Fetches from the URI and returns the response, parsing the body if the
content-type is recognised. Returns an error if the status code does not
represent a successful response.

Arguments:
- method: The HTTP method to use. Defaults to `GET`.
- headers: The headers to send with the request. Defaults to an empty vector.
- parse: If successful should the body be parsed to an Enso native object.
URI.fetch : HTTP_Method -> Vector (Header | Pair Text Text) -> Boolean -> Any
URI.fetch self method=HTTP_Method.Get headers=[] parse=True =
Data.fetch self method headers parse
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ type Array
each_with_index : (Integer -> Any -> Any) -> Nothing
each_with_index self f = Vector.each_with_index self f

## Concatenates two arrays, resulting in a new `Vector`, containing all the
## ALIAS Concatenate
Concatenates two arrays, resulting in a new `Vector`, containing all the
elements of `self`, followed by all the elements of `that`.

Arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ type Boolean
True
False

## Computes the logical and (conjunction) of two booleans.
## ALIAS And
Computes the logical and (conjunction) of two booleans.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Computes the logical and (conjunction) of two booleans.
Computes the conjunction (logical 'and') of two booleans.

I'm wondering if that form would not be more readable? (low priority)


Arguments:
- that: The boolean to compute the conjunction of this with.
Expand All @@ -31,7 +32,8 @@ type Boolean
&& : Boolean -> Boolean
&& self ~that = @Builtin_Method "Boolean.&&"

## Computes the logical or (disjunction) of two booleans.
## ALIAS Or
Computes the logical or (disjunction) of two booleans.

Arguments:
- that: The boolean to compute the disjunction of this with.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,6 @@ type Filter_Condition
Not_In values -> "is not in " + values.to_display_text
"Filter Condition: " + condition

## PRIVATE
Gets a widget set up for a Filter_Condition.
default_widget : Widget
default_widget =
names = ["Equal", "Not Equal", "Is In", "Not In", "Is True", "Is False", "Is Nothing", "Not Nothing", "Is Empty", "Not Empty", "Less", "Equal Or Less", "Greater", "Equal Or Greater", "Between", "Starts With", "Ends With", "Contains", "Not Contains", "Like", "Not Like"]
values = ["(Filter_Condition.Equal)", "(Filter_Condition.Not_Equal)", "(Filter_Condition.Is_In)", "(Filter_Condition.Not_In)", "Filter_Condition.Is_True", "Filter_Condition.Is_False", "Filter_Condition.Is_Nothing", "Filter_Condition.Not_Nothing", "Filter_Condition.Is_Empty", "Filter_Condition.Not_Empty", "(Filter_Condition.Less)", "(Filter_Condition.Equal_Or_Less)", "(Filter_Condition.Greater)", "(Filter_Condition.Equal_Or_Greater)", "(Filter_Condition.Between)", "(Filter_Condition.Starts_With)", "(Filter_Condition.Ends_With)", "(Filter_Condition.Contains)", "(Filter_Condition.Not_Contains)", "(Filter_Condition.Like)", "(Filter_Condition.Not_Like)"]
options = names.zip values . map p-> Option p.first p.second
Single_Choice values=options display=Display.Always

## PRIVATE
sql_like_to_regex sql_pattern =
regex_pattern = Regex_Utils.sql_like_pattern_to_regex sql_pattern
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,5 +445,6 @@ type Locale
widget_options : Vector Option
widget_options = Locale.predefined_locale_fields.map field_name->
display_string = field_name.replace '_' ' ' . to_case (if field_name.length == 2 then Case.Upper else Case.Title)
code_string = "Locale." + field_name
fqn = Meta.get_qualified_type_name Locale
code_string = fqn + "." + field_name
jdunkerley marked this conversation as resolved.
Show resolved Hide resolved
Option display_string code_string
Loading