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

merge various branch fixes together #15

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open

Conversation

tbal999
Copy link

@tbal999 tbal999 commented Jul 27, 2022

I believe the blues branch of go-jsonata is now inactive -
for latest version refer to xiatechs/jsonata branch for this commit

includes commits from https://github.com/ASJadeTech/jsonata-go
and https://github.com/xiatechs/jsonata-go

features:

  • add refactored decimal precision logic
  • add ability to include /* comments */ and ability to use $."Fields with spaces"
  • adds a simple join function 0 $sjoin(obj1, obj2, "id", "id) etc

frank-hsieh-asj and others added 6 commits February 17, 2022 14:44
♻️ float to decimal & set DivisionPrecision = 8
this enables:
	- comments in jsonata code
	- fields with any character in their name
add more accurate division
@tbal999 tbal999 marked this pull request as ready for review July 27, 2022 13:49
tbal999 and others added 7 commits November 29, 2022 16:39
* update dev

* add mutex

* another

* and another

* fix tests etc

Co-authored-by: tbal999 <[email protected]>
tbal999 and others added 30 commits March 15, 2023 13:11
* add eval functionality

* a more fancy eval

* fixes

* fully fleshed out eval

* update

---------

Co-authored-by: tbal999 <[email protected]>
Co-authored-by: tbal999 <[email protected]>
* Add a failing test for time parsing

* Remove idea

* test

* Revert old error change

* Fix

* Add another test

* Fix

* Add fix incase there were spaces

* Fix a few more edge cases

* More edge cases

* Finaly fixes

* Remove milliseconds when a date time comes in

* Remove test from the root
* add panic recover

* Fix error string within From Millis function

* Add to millis fix

* Use MST

---------

Co-authored-by: tbal999 <[email protected]>
* add local consts

* add test to CI

---------

Co-authored-by: tbal999 <[email protected]>
Co-authored-by: tbal999 <[email protected]>
In Jsonata it is a valid response return `[]any{}` from a transform, but
this was previously filtered out.

For example, in jsonata-js, the following input and transform result in
a response of `[]`.
Input:
```
{
  "Account": {
    "Account Name": "Firefly",
    "Order": [
    ]
  }
}
```
Transform: "Account.Order"

The same data and transform resulted in a "no results found" error in
jsonata-go.
* Added new function ObjectsToDocument

* lint & fixes

* Updated to remove type conversion as already converted in the JSONata

* add some errors

---------

Co-authored-by: James Weeks <[email protected]>
Co-authored-by: tbal999 <[email protected]>
* Added new function ObjectsToDocument

* lint & fixes

* Updated to remove type conversion as already converted in the JSONata

* Added new JSONata function OneToManyJoin

* add tests to assert behaviour

* test

* remove usage of reflect

---------

Co-authored-by: James Weeks <[email protected]>
Co-authored-by: tbal999 <[email protected]>
* add hash256 func

* add hash hasStr function

---------

Co-authored-by: tbal999 <[email protected]>
* add hash256 func

* add hash hasStr function

* timedatedim

* remove artifact

* latest changes

* adjustments

* passes

* correction

* update hash

* add UTC field todo

* remove old field

* erase comments

* cleanup

* tests

* bolt on timedatedim

* correction

* add require

* add timeparse / raw constr

* abstract

* remove outputdata debug data

* add gitignore

* test

* update to integers

* adjustments

* add test data

* fix

* fix

* added test case

* added comment

* add lite version

* add raw value

* fix

* add

* gofmt

* add january test case

* fix

* remove Z

* add more tests

---------

Co-authored-by: tbal999 <[email protected]>
Co-authored-by: tbal999 <[email protected]>
* Enhancement to oneToMany function to add sql like join types

* migrate & add non-reflect methods

* fix

---------

Co-authored-by: JamesXiatech <[email protected]>
Co-authored-by: tbal999 <[email protected]>
Co-authored-by: tbal999 <[email protected]>
* Added new function to rename object keys

* Added unit test for RenameKeys
Co-authored-by: tbal999 <[email protected]>
* add fold function logic

* replace with goccy

* test

---------

Co-authored-by: tbal999 <[email protected]>
* remove the 000 timestmp

* remove wednesday checking

---------

Co-authored-by: tbal999 <[email protected]>
This fixes the following panic:
```
panic: runtime error: hash of unhashable type []interface {}
goroutine 176 [running]:
http://github.com/xiatechs/jsonata-go/jlib.Distinct ({0x1087cc0?, 0xc000661368?, 0x0?})
	/go/pkg/mod/github.com/xiatechs/[email protected]/jlib/array.go:61 +0x3e5
reflect.Value.call({0x10c10a0?, 0x1404a18?, 0x4cadbf?}, {0x1318275, 0x4}, {0xc000661590, 0x1, 0x0?})
	/usr/local/go/src/reflect/value.go:596 +0xce5
reflect.Value.Call({0x10c10a0?, 0x1404a18?, 0x1?}, {0xc000661590?, 0xc000661590?, 0x1087d00?})
	/usr/local/go/src/reflect/value.go:380 +0xb9
```
* add monday-weekday

* chore: just use isoweek twice

* chore: fix test

* chore: pushed

* update

* chore: update tests

* chore: remove uneeded func

* chore: update testdata

---------

Co-authored-by: tbal999 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants