Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
235f114
Hashset work.
jdunkerley Jan 22, 2026
c923939
Dictionary conversions.
jdunkerley Mar 17, 2026
ec66349
Sort to_text, to_display_text and pretty for Hashset and Dictionary.
jdunkerley Mar 17, 2026
7418e27
Sort Table viz for Hashset.
jdunkerley Mar 17, 2026
4d518c3
Make JsonOperation have an instance for VIZ use and separate the Tabl…
jdunkerley Mar 17, 2026
f4d8715
Fixes.
jdunkerley Mar 17, 2026
41b5f51
Add `json_stringify` to `Any` and `Column`.
jdunkerley Mar 17, 2026
701ae2b
JSON format.
jdunkerley Mar 17, 2026
2d9be40
Fix copy paste bug.
jdunkerley Mar 17, 2026
c61d812
Make Hashset.Value private and remove unused comparator.
jdunkerley Mar 18, 2026
42cf168
Tests part 1
jdunkerley Mar 18, 2026
ff6ae8e
Fix for Column.json_stringify and tests.
jdunkerley Mar 18, 2026
bd0e82d
Docs.
jdunkerley Mar 18, 2026
3b83b73
Changelog.
jdunkerley Mar 18, 2026
da0baf7
Copy/paste error.
jdunkerley Mar 18, 2026
93e2ac2
Docs and lint fixes.
jdunkerley Mar 18, 2026
72c793e
Refactor so JsonOperation implements UnaryOperation and separate all …
jdunkerley Mar 18, 2026
9d5c35e
Java format.
jdunkerley Mar 18, 2026
5bdfbe5
Fixes and prototype for parse_json via map
jdunkerley Mar 18, 2026
b12bf2d
Start of the parse_json for a Column.
jdunkerley Mar 18, 2026
d6f9d9a
Add support for Array in the JSON read.
jdunkerley Mar 18, 2026
a3aa433
Support for the JSON objects.
jdunkerley Mar 19, 2026
9816186
Add `parse_json` to the `Table`.
jdunkerley Mar 19, 2026
fc89007
Java format.
jdunkerley Mar 19, 2026
674dfc8
Fixes and Docs.
jdunkerley Mar 19, 2026
45f9bdf
XML_Document to XML_Element conversion.
jdunkerley Mar 19, 2026
3c86a4d
Add `get_xpath_text` to `XML_Element` and `XML_Document`.
jdunkerley Mar 19, 2026
d193a5d
Remove `Any.json_stringify`
jdunkerley Mar 20, 2026
0279923
Remove `Any.json_stringify` docs.
jdunkerley Mar 20, 2026
12d8f7b
Move XML code to Java
jdunkerley Mar 20, 2026
3b0fb07
Complete moving XML code to Java
jdunkerley Mar 20, 2026
85a25db
Remove ToDo.
jdunkerley Mar 20, 2026
4b33b8e
Docs.
jdunkerley Mar 20, 2026
73c8043
Default arguments.
jdunkerley Mar 20, 2026
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 @@ -45,6 +45,7 @@
- [Expanded S3 API with versions and signed uri][14831]
- [Support for reading JSON data from database connections.][14872]
- [Add Redshift bulk loading][14860]
- [JSON functions on Table and Column. XML and Hashset fixes.][14884]

[14522]: https://github.com/enso-org/enso/pull/14522
[14476]: https://github.com/enso-org/enso/pull/14476
Expand All @@ -62,6 +63,7 @@
[14831]: https://github.com/enso-org/enso/pull/14831
[14872]: https://github.com/enso-org/enso/pull/14872
[14860]: https://github.com/enso-org/enso/pull/14860
[14884]: https://github.com/enso-org/enso/pull/14884

#### Enso Language & Runtime

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
- map_keys self function:Standard.Base.Any.Any -> Standard.Base.Any.Any
- map_with_key self function:Standard.Base.Any.Any -> Standard.Base.Any.Any
- not_empty self -> Standard.Base.Any.Any
- pretty self -> Standard.Base.Any.Any
- remove self key:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- singleton key:Standard.Base.Any.Any value:Standard.Base.Any.Any -> Standard.Base.Any.Any
- size self -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- to_text self -> Standard.Base.Any.Any
- to_vector self -> Standard.Base.Any.Any
- transform self function:Standard.Base.Any.Any -> Standard.Base.Any.Any
- values self -> Standard.Base.Any.Any
- key_value_widget -> Standard.Base.Metadata.Widget
- key_widget dict:Standard.Base.Data.Dictionary.Dictionary -> Standard.Base.Metadata.Widget
- Standard.Base.Data.Dictionary.Dictionary.from that:Standard.Base.Data.Vector.Vector -> Standard.Base.Data.Dictionary.Dictionary
- Standard.Base.Data.Dictionary.Dictionary.from that:Standard.Base.Data.Vector.Vector error_on_duplicates:Standard.Base.Data.Boolean.Boolean= -> Standard.Base.Data.Dictionary.Dictionary
- Standard.Base.Data.Vector.Vector.from that:Standard.Base.Data.Dictionary.Dictionary -> Standard.Base.Data.Vector.Vector
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
## Enso Signatures 1.0
## module Standard.Base.Data.Hashset
- type Hashset
- Value underlying_dictionary:(Standard.Base.Data.Dictionary.Dictionary Standard.Base.Any.Any Standard.Base.Nothing.Nothing)
- contains self value:Standard.Base.Any.Any -> Standard.Base.Any.Any
- contains_relational self value:Standard.Base.Any.Any -> Standard.Base.Any.Any
- difference self other:Standard.Base.Data.Hashset.Hashset -> Standard.Base.Any.Any
- empty -> Standard.Base.Any.Any
- from_vector vector:Standard.Base.Data.Vector.Vector error_on_duplicates:Standard.Base.Data.Boolean.Boolean= -> Standard.Base.Any.Any
- insert self value:Standard.Base.Any.Any -> Standard.Base.Any.Any
- from_vector values:Standard.Base.Data.Vector.Vector error_on_duplicates:Standard.Base.Data.Boolean.Boolean= -> Standard.Base.Data.Hashset.Hashset!Standard.Base.Errors.Illegal_Argument.Illegal_Argument
- insert self value:Standard.Base.Any.Any -> Standard.Base.Data.Hashset.Hashset
- intersection self other:Standard.Base.Data.Hashset.Hashset -> Standard.Base.Any.Any
- is_empty self -> Standard.Base.Any.Any
- length self -> Standard.Base.Any.Any
- not_empty self -> Standard.Base.Any.Any
- pretty self -> Standard.Base.Any.Any
- size self -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- to_text self -> Standard.Base.Any.Any
- to_vector self -> Standard.Base.Any.Any
- union self other:Standard.Base.Data.Hashset.Hashset -> Standard.Base.Any.Any
- type Hashset_Comparator
- compare x:Standard.Base.Any.Any y:Standard.Base.Any.Any -> Standard.Base.Any.Any
- hash x:Standard.Base.Any.Any -> Standard.Base.Any.Any
- Standard.Base.Data.Hashset.Hashset.from that:Standard.Base.Data.Vector.Vector error_on_duplicates:Standard.Base.Data.Boolean.Boolean= -> Standard.Base.Data.Hashset.Hashset
- Standard.Base.Data.Vector.Vector.from that:Standard.Base.Data.Hashset.Hashset -> Standard.Base.Data.Vector.Vector
34 changes: 15 additions & 19 deletions distribution/lib/Standard/Base/0.0.0-dev/docs/api/Data/XML.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,44 @@
## module Standard.Base.Data.XML
- type XML_Document
- at self key:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer)= -> Standard.Base.Any.Any
- attribute self name:Standard.Base.Data.Text.Text ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- attribute self name:Standard.Base.Data.Text.Text= ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- attribute_names self -> Standard.Base.Any.Any
- attributes self -> Standard.Base.Any.Any
- child_count self -> Standard.Base.Any.Any
- child_names self -> Standard.Base.Any.Any
- children self -> Standard.Base.Any.Any
- from_file file:Standard.Base.System.File.File -> Standard.Base.Any.Any
- from_file file:Standard.Base.System.File.File= -> Standard.Base.Any.Any
- from_stream input_stream:Standard.Base.System.Input_Stream.Input_Stream -> Standard.Base.Any.Any
- from_text xml_string:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get self key:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer)= ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- get_child_element self key:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer)= -> Standard.Base.Any.Any
- get_children_by_tag_name self tag_name:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_descendants_by_tag_name self tag_name:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_xpath self key:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_children_by_tag_name self tag_name:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_descendants_by_tag_name self tag_name:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_xpath self key:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_xpath_text self key:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- inner_xml self -> Standard.Base.Any.Any
- name self -> Standard.Base.Any.Any
- new doc:Standard.Base.Data.XML.Document -> Standard.Base.Any.Any
- outer_xml self -> Standard.Base.Any.Any
- parse xml_string:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- parse xml_string:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- root_element self -> Standard.Base.Any.Any
- text self -> Standard.Base.Any.Any
- to_default_visualization_data self -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- to_js_object self -> Standard.Base.Any.Any
- write self path:Standard.Base.System.File.Generic.Writable_File.Writable_File encoding:Standard.Base.Data.Text.Encoding.Encoding= on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= include_xml_declaration:Standard.Base.Data.Boolean.Boolean= on_problems:Standard.Base.Errors.Problem_Behavior.Problem_Behavior= -> Standard.Base.Any.Any
- write self path:Standard.Base.System.File.Generic.Writable_File.Writable_File= encoding:Standard.Base.Data.Text.Encoding.Encoding= on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= include_xml_declaration:Standard.Base.Data.Boolean.Boolean= on_problems:Standard.Base.Errors.Problem_Behavior.Problem_Behavior= -> Standard.Base.Any.Any
- type XML_Element
- at self key:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer)= -> Standard.Base.Any.Any
- attribute self name:Standard.Base.Data.Text.Text ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- attribute self name:Standard.Base.Data.Text.Text= ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- attribute_names self -> Standard.Base.Any.Any
- attributes self -> Standard.Base.Any.Any
- child_count self -> Standard.Base.Any.Any
- child_names self -> Standard.Base.Any.Any
- children self -> Standard.Base.Any.Any
- get self key:(Standard.Base.Data.Text.Text|Standard.Base.Data.Numbers.Integer)= ~if_missing:Standard.Base.Any.Any= -> Standard.Base.Any.Any
- get_children_by_tag_name self tag_name:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_descendants_by_tag_name self tag_name:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_xpath self key:Standard.Base.Data.Text.Text -> Standard.Base.Any.Any
- get_children_by_tag_name self tag_name:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_descendants_by_tag_name self tag_name:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_xpath self key:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- get_xpath_text self key:Standard.Base.Data.Text.Text= -> Standard.Base.Any.Any
- inner_xml self -> Standard.Base.Any.Any
- name self -> Standard.Base.Any.Any
- new java_element:Standard.Base.Any.Any -> Standard.Base.Any.Any
Expand All @@ -47,14 +48,9 @@
- to_default_visualization_data self nested:Standard.Base.Data.Boolean.Boolean= as_js_object:Standard.Base.Data.Boolean.Boolean= -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- to_js_object self -> Standard.Base.Any.Any
- write self path:Standard.Base.System.File.Generic.Writable_File.Writable_File encoding:Standard.Base.Data.Text.Encoding.Encoding= on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= include_xml_declaration:Standard.Base.Data.Boolean.Boolean= on_problems:Standard.Base.Errors.Problem_Behavior.Problem_Behavior= -> Standard.Base.Any.Any
- write self path:Standard.Base.System.File.Generic.Writable_File.Writable_File= encoding:Standard.Base.Data.Text.Encoding.Encoding= on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= include_xml_declaration:Standard.Base.Data.Boolean.Boolean= on_problems:Standard.Base.Errors.Problem_Behavior.Problem_Behavior= -> Standard.Base.Any.Any
- type XML_Error
- Other error:Standard.Base.Data.Text.Text
- Parse_Error line_number:Standard.Base.Data.Numbers.Integer column_number:Standard.Base.Data.Numbers.Integer
- handle_java_exceptions ~action:Standard.Base.Any.Any -> Standard.Base.Any.Any
- to_display_text self -> Standard.Base.Any.Any
- wrap_java_exception exception:Standard.Base.Data.XML.JException -> Standard.Base.Any.Any
- build_child_list java_element:Standard.Base.Any.Any -> Standard.Base.Any.Any
- child_selector node:(Standard.Base.Data.XML.XML_Element|Standard.Base.Data.XML.XML_Document) -> Standard.Base.Any.Any
- only_wanted_nodes node_list:Standard.Base.Data.XML.NodeList -> Standard.Base.Any.Any
- write_impl node:Standard.Base.Data.XML.Node path:Standard.Base.System.File.Generic.Writable_File.Writable_File encoding:Standard.Base.Data.Text.Encoding.Encoding= on_existing_file:Standard.Base.System.File.Existing_File_Behavior.Existing_File_Behavior= include_xml_declaration:Standard.Base.Data.Boolean.Boolean= on_problems:Standard.Base.Errors.Problem_Behavior.Problem_Behavior= -> Standard.Base.Any.Any
- Standard.Base.Data.XML.XML_Element.from that:Standard.Base.Data.XML.XML_Document -> Standard.Base.Data.XML.XML_Element
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,22 @@ type Dictionary key value
to_text : Text
to_text self = @Builtin_Method "Dictionary.to_text"

## ---
private: true
---
to_display_text : Text
to_display_text self =
texts = self.keys.take (..First 40) . map k-> k.to_display_text + "=" + (self.get k . to_display_text)
suffix = if self.length > 40 then " and " + (self.length - 40).to_text + " more elements}" else "}"
"{" + (texts.join ", ") + suffix

## ---
private: true
---
pretty : Text
pretty self =
"Dictionary.from_vector " + self.to_vector.pretty

## ---
private: true
---
Expand All @@ -538,7 +554,9 @@ key_value_widget -> Widget =
item_editor = Single_Choice display=..Always values=[pair]
Vector_Editor item_editor=item_editor display=..Always item_default=default

## ---
private: true
---
Dictionary.from (that:Vector) = Dictionary.from_vector that
## Convert a Vector of key-value pairs to a Dictionary.
Dictionary.from (that:Vector) (error_on_duplicates:Boolean=True) =
Dictionary.from_vector that error_on_duplicates

## Convert Dictionary to a Vector.
Vector.from (that:Dictionary) = that.to_vector
48 changes: 29 additions & 19 deletions distribution/lib/Standard/Base/0.0.0-dev/src/Data/Hashset.enso
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ import project.Any.Any
import project.Data.Array_Proxy.Array_Proxy
import project.Data.Dictionary.Dictionary
import project.Data.Numbers.Integer
import project.Data.Ordering.Ordering
import project.Data.Text.Text
import project.Data.Vector.Vector
import project.Errors.Illegal_Argument.Illegal_Argument
import project.Nothing.Nothing
from project.Data.Boolean import Boolean, False, True
from project.Data.Text.Extensions import all
from project.Metadata.Widget import Vector_Editor
from project.Widget_Helpers import make_all_selector

## An unordered collection of unique values.
type Hashset
## ---
private: true
---
Value (underlying_dictionary : Dictionary Any Nothing)
private Value (underlying_dictionary : Dictionary Any Nothing)

## ---
private: true
aliases: [set]
icon: array_new2
advanced: true
---
Constructs a new set from a vector.
Expand All @@ -30,9 +32,9 @@ type Hashset
occurrence of each duplicated element is retained in the set. If set to
`True` it will raise an `Illegal_Argument` if duplicate elements are
encountered.
from_vector : Vector Any -> Boolean -> Hashset ! Illegal_Argument
from_vector (vector : Vector) (error_on_duplicates : Boolean = False) =
pairs_array = Array_Proxy.new vector.length (i-> [vector.at i, Nothing])
@values (Vector_Editor item_editor=make_all_selector display=..Always item_default="Nothing")
from_vector (values : Vector) (error_on_duplicates : Boolean = False) -> Hashset ! Illegal_Argument =
pairs_array = Array_Proxy.new values.length (i-> [values.at i, Nothing])
pairs = Vector.from_polyglot_array pairs_array
dictionary = Dictionary.from_vector pairs error_on_duplicates=error_on_duplicates
Hashset.Value dictionary
Expand Down Expand Up @@ -120,8 +122,8 @@ type Hashset
icon: row_add
---
Adds a value to this set.
insert : Any -> Hashset
insert self value =
@value (make_all_selector ..Always)
insert self value:Any -> Hashset =
dictionary = self.underlying_dictionary.insert value Nothing
Hashset.Value dictionary

Expand Down Expand Up @@ -165,22 +167,30 @@ type Hashset
private: true
---
to_text : Text
to_text self = self.to_vector.map .pretty . join ", " "Hashset{" "}"
to_text self =
inner = self.to_vector.to_text
"{" + (inner.drop (..First 1) . drop (..Last 1)) + "}"

## ---
private: true
---
type Hashset_Comparator
## ---
private: true
---
compare x y =
if x.size != y.size then Nothing else
if (x.difference y).is_empty then Ordering.Equal else Nothing
to_display_text : Text
to_display_text self =
texts = self.underlying_dictionary.keys.take (..First 40) . map _.to_display_text
suffix = if self.length > 40 then " and " + (self.length - 40).to_text + " more elements}" else "}"
"{" + (texts.join ", ") + suffix

## ---
private: true
---
hash x =
vec = x.to_vector.sort . remove_warnings
Ordering.hash vec
pretty : Text
pretty self =
"Hashset.from_vector " + self.to_vector.pretty

## Convert from a Vector to a Hashset
Hashset.from (that:Vector) (error_on_duplicates:Boolean=False) =
Hashset.from_vector that error_on_duplicates

## Convert from a Hashset to a Vector
Vector.from (that:Hashset) =
that.to_vector
Loading
Loading