Commit Graph

757 Commits

Author SHA1 Message Date
James Dunkerley
19f15b8f97
Small fixes from building up another demo. (#9385)
- Fix `Excel_Workbook.sheet` and add a test.
- Add icon for `Table.row_count` and `DB_Table.row_count`.
- Make `join_kind` widget `Display.Always`.
- Add expression as an option to `Aggregate_Column`.
- Add `Simple_Calculation.Copy` to create a copy.
- Add defaults to `Simple_Expression` so less errory.
- Set period to default to day for `date_diff` allowing use in expressions.
- Add `Text_Left`, `Text_Right`, `Text_Length` and `Format` to `Simple_Expression`.
2024-03-13 18:13:33 +00:00
Hubert Plociniczak
f82e8020fe
Arrow builder is not an Array (#9358)
Follow up on #9150 - making sure that Arrow builder is not accidentally treated as an Array by disallowing reading elements.

# Important Notes
Also making sure that the length of the resulting Arrow Array is consistent with what user requested.
2024-03-13 14:37:41 +00:00
AdRiley
2fdb2fca62
Added Table.running (#9382)
This is a first naïve implementation of Table.running that only supports count. Adding it as a scaffold for the rest of the functionality and to give us a place to agree on the API. (Which I changed slightly from the design)

![image](https://github.com/enso-org/enso/assets/1720119/a62a83ed-f864-4295-98ea-1007f62381b1)

# Important Notes
Only supports Statistic.Count. Other functionality to follow.
2024-03-13 13:28:33 +00:00
AdRiley
cd4a6d456c
Add xml.write tests and .write to XML_Element (#9332)
* Add xml.write tests and write to XML_Element

* Code Review changes

* Fix tests
2024-03-11 16:26:06 +00:00
Radosław Waśko
e98306f170
Excel DataLink (#9346)
- Adds the Excel format as one of the formats supported when creating a data link.
- The data link can choose to read the file as a workbook, or read a sheet or range from it as a table, like `Excel_Format`.
- Also updated Delimited format dialog to allow customizing the quote style.
2024-03-11 16:12:12 +00:00
Radosław Waśko
2e35189d83
Better error message in Data.read when an argument to format is missing (#9337) 2024-03-11 14:50:32 +00:00
James Dunkerley
9f9cf58d28
Add selecting by type to the table (#9334)
- Adds `select_by_type` and `remove_by_type` to tables.
2024-03-08 18:40:53 +00:00
Hubert Plociniczak
f80dd9f593
Demonstrate usage of foreign arrow function (#9150)
Including arrow language in the distribution by default. Added a basic example for creating an Arrow array.
Making sure that memory layout agrees with Arrow specification (padding, continuous allocation of memory chunks).
Related to #9118.

This should unblock work on allowing serialization/deserialization to/from Parquet but I'd like to delay it to a follow up ticket as it is going to be a significant amount of specialized work.
2024-03-08 15:20:55 +00:00
Radosław Waśko
a3bf5a0be5
Split Excel_Format into 3 constructors (#9308)
Splitting the `Excel_Format` into 3 constructors.
2024-03-08 14:26:30 +00:00
James Dunkerley
c7d693dfc8
Move Standard.Database.Data to Standard.Database. (#9321)
Moves the types out of `Data`.
2024-03-07 14:43:38 +00:00
Radosław Waśko
e37862b09d
Implement a Data Link for Postgres (#9269)
- Closes #9124
2024-03-06 11:57:12 +00:00
Jaroslav Tulach
6acec1b30b
Use .. to identify autoscoped constructors (#9285) 2024-03-06 10:28:15 +01:00
Radosław Waśko
5d00a6110d
Fix cleanup of secrets in tests (#9254)
- Adds a missing finalizer to a test
- Adds a workaround for #9251 bug
2024-03-04 17:44:31 +00:00
AdRiley
8b889f0977
Make Table.To_Xml return a XML_Document (#9263)
As part of the XML improvements it makes more sense for Table.To_Xml to return a XML_Document.
2024-03-04 15:19:20 +00:00
Jaroslav Tulach
5676618bad
Autoscoped constructors (#9190)
Fixes #8645 by recognizing `~` prefix to constructor names.
2024-03-04 11:41:02 +00:00
Radosław Waśko
39af372bcd
Allow resolving enso:// URIs in Data.read and other places (#9225)
- Implements the core parts of #9048
- Currently the path resolution is done by resolving each segment, one by one - requiring as many API calls as there are segments in the path.
- This should be replaced in a followup PR, once https://github.com/enso-org/cloud-v2/issues/899 is implemented.
2024-03-02 16:04:30 +00:00
James Dunkerley
964fdfd7ea
Align XML_Document and XML_Element APIs more. (#9233)
- Added `to_table` extensions on some core types.
- Added ICON to `Any.to`.
- Added ICON to `Column.info`, `Table.info`, `DB_Column.info` and `DB_Table.info`.
- Added defaults to `Table.cross_tab` and `DB_Table.cross_tab`.
- Added `name`, `get`, `at`, `inner_xml` and `outer_xml` to `XML_Document`.
- Added constants into left hand side of simple expressions.
- Added widget to `get` and `at` on `XML_Document` and `XML_Element`. (Some bug in annotation code with Dmitry)
- Altered `get` and `at` to not allow XPath and just get direct child/attribute values.
- Added `get_xpath` to `XML_Document`.
- Renamed `get_elements_by_tag_name` to `get_descendants_by_tag_name` and added new `get_children_by_tag_name`.
- Added `child_names` and `attribute_names` to `XML_Document` and `XML_Element`.
2024-03-01 17:42:44 +00:00
Radosław Waśko
4316709379
Implementing reading Data Links (#9215)
- Close #9123
2024-03-01 15:33:21 +00:00
GregoryTravis
54675b1e4d
Implement Table.replace for the database backend (#8986) 2024-02-29 18:36:42 +00:00
Radosław Waśko
386132cdab
Fix matching JS strings (#9203)
- Fixes #9202
2024-02-29 15:07:29 +00:00
James Dunkerley
8f2b9da664
IsNa to IsNothing, missing to Nothing in Table code. (#9154)
Starting to use Nothing everywhere...
2024-02-26 10:52:07 +00:00
James Dunkerley
0e2a91cfe1
Remove countMissing from Storage and replace with a new CountNothing operation. (#9137)
Removing another small piece of logic from the storages to it's own operation.
2024-02-22 19:32:46 +00:00
Radosław Waśko
d817df94a5
Move Enso_Cloud from Data to top-level in Standard.Base (#9140)
- 4 weeks ago we discussed with @jdunkerley we may want to move this module.
- `Data` is a submodule mostly for various data-structures etc., the cloud stuff did not fit that well in there.
2024-02-22 14:42:35 +00:00
Jaroslav Tulach
ad2f5b031e
Chained if_then_else application change (#8671)
* Test describing the current behavior of chained if then else application

* Chained block should behave just like Group around if_then_else

* Finishing line on BlockStart fixes if_then_else_chained_block

* Only finish the line when there was not start of a macro segment

* Fix tests

* Refine else-body with macro patterns.

* Update test syntax to maintain original semantics

* Few additional tests

---------

Co-authored-by: Kaz Wesley <kaz@lambdaverse.org>
2024-02-22 09:17:25 -05:00
Pavel Marek
21e1284086
Enso tests can be run with filter from cmdline (#9065)
Simplify the `Test.Suite.run_with_filter` to accept a single filter parameter that searches for all the groups and specs that matches that filter. This filter can be a simple text provided from the command line.

# Important Notes
- Pending groups are now printed at the end of the run
- `Test.Suite.run_with_filter` is simplified to accept a single filter parameter that is either `Text` or `Nothing`. See the docs.
- Passing a filter from the command line is therefore straightforward, it is treated as a regex.
- For convenience, I have left all the `main` methods in all the test sources. I have just refactored them to accept the `filter` argument from the command line.
- For example, to run only a single spec from `Vector_Spec.enso`, invoke `enso --run test/Base_Tests/src/Data/Vector_Spec.enso "should allow vector creation with a programmatic constructor"`
- **Majority of the PR is a regex replace** of `^main =` for `main filter=Nothing =` and of `suite.run_with_filter` for `suite.run_with_filter filter`.
- **Fixed some internal engine bugs:**
- `AtomWithHole` allows to specify only one hole - https://github.com/enso-org/enso/pull/9065/files#diff-0f7bb7e85cf86a965de133aa7e6b5958ceb889bd1921c01e00d3a9ceb19626ef
- NaN keys in hash maps are handled in polyglot maps as well - c5257f6c2b78f893214ff67300893b593ea05e21..db4b3c0e9828ee79208d52e02586b24bb845b0d6
2024-02-22 12:31:44 +00:00
James Dunkerley
e50ded8b24
Rename new_name to as on Aggregate_Column. (#9135)
Small tweak renaming a property.
![image](https://github.com/enso-org/enso/assets/4699705/21f4ca29-2219-412b-a650-c900360f9dea)
2024-02-22 10:34:00 +00:00
Radosław Waśko
d845e709a1
Refactor S3 path handling (#9092)
- Closes #9021
2024-02-22 09:15:34 +00:00
James Dunkerley
fa6fccb99e
Refactoring Table.set for GUI2 and other GUI fixes (#9128)
- Added `regex` function to `Standard.Base` as a way to easily and cleanly make regular expressions.
- Added `expr` and `Expression.Value` to distinguish expressions from text values.
- Fixed issues with `Table.join` widget so dropdown exists.
- Needed fully qualified name.
- Added default empty text values for right column to provided text input boxes.
- Deprecate `Table.filter_by_expression` and allow `Table.filter` to take an `Expression`.
- Added `Simple_Expression` and deprecated `Column_Operation`. Changes the order so takes a column then a calculation.
- Rename `column` to `value` and `new_name` to `as` on `Table.set`.
- Rename `name_column` to `names` on `Table.cross_tab`.
- Removed `Column_Ref.Expression` in favour of using `Expression.Value`.
2024-02-21 23:51:41 +00:00
Jaroslav Tulach
2a42388905
Including missing Polyglot_Spec in all the tests (#9126) 2024-02-21 16:16:00 +01:00
AdRiley
4cbdc9dfb6
Remove table aliases (#9098)
Now Table and DB_Table have different names we can remove a lot of aliases. This closes #8981
2024-02-20 01:03:57 +00:00
Radosław Waśko
167a91dab1
Updating Enso Cloud integration - cheaper Enso_Secret.create, introducing Enso_File.creation_time and last_modified_time (#9085)
- Closes #9047
2024-02-19 18:53:20 +00:00
AdRiley
27ec236c19
rename database Table to DB_Table (#9067)
Rename database.Table to database.DB_Table to avoid name collisions as part of https://github.com/enso-org/enso/issues/8981
2024-02-19 17:31:58 +00:00
James Dunkerley
ee66b9fb1d
Refactoring the Unary operations so uncoupled from Storage. (#9090)
In order to allow clever masking, slicing, filtering and arrow backing stores...

- Adding ColumnStorage interface with the base API a storage will need.
- Refactored each of the unary operations to a new `UnaryOperation` interface which makes them responsible for deciding if they can be executed.
2024-02-19 17:11:52 +00:00
Jaroslav Tulach
a664dd9d56
Equality with conversions (#9070) 2024-02-19 17:18:56 +01:00
Radosław Waśko
cf71a05c3b
Refactor common context handling pattern (#9087) 2024-02-19 11:59:42 +00:00
Radosław Waśko
642d5a691e
Implement copy_to and move_to for S3_File (#9054)
- Closes #8833
- Tests for copying between S3 and `Enso_File` will only be added once we implement Enso_File writing.
2024-02-16 10:42:28 +00:00
James Dunkerley
f2d2f73e89
Starting to refactor Storage and Operations (#9076)
Cleaning up some of the structures in Storage before working on UnaryOperations.

- Removed some legacy code: `countMask`, `Index` and `DefaultIndex`.
- Renamed `mask` to `applyFilter` on `Column` and `Storage`.
- Renamed `Table.mask` to `Table.filter`.
2024-02-15 18:21:07 +00:00
AdRiley
f4955815b2
Remove Column Aliases (#9056) 2024-02-14 19:06:29 +00:00
James Dunkerley
08584b0423
Improving experience with format and parse. (#9045)
- Add format dropdown to `Number.format`.
![image](https://github.com/enso-org/enso/assets/4699705/8aa74910-c6ad-4480-a7f2-04dacd9686e8)

- Support case insensitive month names and abbreviations in dates.
https://github.com/enso-org/enso/assets/4699705/4dbd8755-e1c2-4207-a8a1-65b427ca4fab

- Improve locale dropdown for `parse_date` and `parse_date_time`.
![image](https://github.com/enso-org/enso/assets/4699705/5d605a2d-1248-46be-bc74-34a4afecf609)

- Added dropdown to `Table.parse` and amended so now doesn't accept `Nothing` (using empty string instead).
![image](https://github.com/enso-org/enso/assets/4699705/340dd093-77db-4685-a34b-45ce09e3c3b3)

- Added dropdown to `Table.format` and amended so now doesn't accept `Nothing` (using empty string instead).

- Altered `Column.parse` to not accept `Nothing` and added drop down for format.
- Altered `Column.format` to not accept `Nothing` and added drop down for format conditional on type.
- Improved the locale date/time format drop to have the suggested formats too.
2024-02-14 16:30:37 +00:00
Radosław Waśko
d45f0fe4df
Check type of self in static dispatch (#8867)
- Fixes #8805
- also btw. fixes #8706
2024-02-14 15:50:13 +00:00
AdRiley
5c7947ce60
Rename database column to DB_Column (#9046)
Rename database column to DB_Column to avoid name collisions as part of https://github.com/enso-org/enso/issues/8981
2024-02-14 09:11:52 +00:00
GregoryTravis
3bdd1a0dce
Re-fetch Warnings in Warning.getWarnings() to correctly wrap them (#9011) 2024-02-13 15:12:32 +00:00
James Dunkerley
8c197f325b
Update the aggregate API to take a separate group_by (#9027)
Separate out the `Group_By` from the column definition in `aggregate`.
![image](https://github.com/enso-org/enso/assets/4699705/6b4f03bc-1c4a-4582-b38a-ba528ae94167)

Supports the old API with a warning attached about deprecation:
![image](https://github.com/enso-org/enso/assets/4699705/0cc42ff7-6047-41a5-bb99-c717d06d0d93)

Widgets have been updated with `Group_By` removed from the dropdown.
2024-02-13 10:23:59 +00:00
Radosław Waśko
eb59b475f6
Write support for S3 (#8921)
- Closes #8809
2024-02-12 19:04:13 +00:00
James Dunkerley
f257952680
Changing Widgets to work better with GUI2 (#9017)
- Rename `Column.replace` to `Column.text_replace` (consistency with Table and allow for adding `Column.replace`).
- Changed Regex insert to be `.to_regex` rather than `Regex.compile`.
https://github.com/enso-org/enso/assets/4699705/3694e876-5b46-49f9-8e8c-352fa0684777

- Adjusted `Table.rename_columns` to insert a `Pair.new` for each rename.
![image](https://github.com/enso-org/enso/assets/4699705/8240f302-498c-46d6-9b77-b1a0f5bb585e)

- Added a `<Regular Expression>` option to the `rename_columns`.
https://github.com/enso-org/enso/assets/4699705/d3c695ad-93f2-419d-b1c1-1f607ca825bd

- Added constant values to `Table.fill_nothing` and made it value type dependent on `Column.fill_nothing`.
https://github.com/enso-org/enso/assets/4699705/26e2e975-e972-46f0-ae1a-6b09dcd39fe6
![image](https://github.com/enso-org/enso/assets/4699705/51393d09-c06b-4eb1-9471-1856430fbfdc)
![image](https://github.com/enso-org/enso/assets/4699705/064fa42b-6187-4816-b3f0-0b7f0f00f6a9)

- Removed `use_regex` option from `Sort_Column.By_Name` (in favour of Regex type).

- Improved widgets for `order_by`. Drop down now on the column name and allow using the Index method with specified numeric range.
![image](https://github.com/enso-org/enso/assets/4699705/549b9c4c-5753-4518-801c-ecd06db5c2e7)
2024-02-12 15:12:19 +00:00
Michał Wawrzyniec Urbańczyk
357f2aadd4
CI: Tweaks for backend tests (#9001)
* Use glob pattern to discover stdlib tests (rather than a hardcoded list).
* Don't fail CI check immediately after failing Scala test.
* Remove meta test suite tests.

# Important Notes
The meta test suite tests are removed following the discussion with @radeusgd. In short, these were failing anyway and were supposed to be rewritten (probably using a different technology, like JUnit). The current code will be a useful reference but it doesn't have to be kept on a repository head. The relevant information and references shall be added to the task.
2024-02-12 13:05:41 +00:00
AdRiley
48a61d7b78
Change empty_error type to array. Add tests (#9019)
* Change error type tp array. Add tests

* Fix tests

* Put this back as it was
2024-02-12 09:15:10 +00:00
AdRiley
9339672e0e
Remove _new and actually run the new tests (#9006)
Merge conflict on develop meant this one got left with a new_test.
2024-02-09 14:19:02 +00:00
AdRiley
1dc8c1cb24
Merge empty_error (#9000)
We don't need 3 copies of empty_error. This PR makes them one.
2024-02-09 14:18:14 +00:00
Pavel Marek
26aa27c9ad
Remove obsolete Test_New import (#9013)
A quickfix after merge conflict introduced by #8991.
2024-02-09 12:27:26 +01:00