Skip to content

Commit

Permalink
Merge branch 'release/1.2.0' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
FranckCo committed Nov 22, 2023
2 parents caacef3 + 6597634 commit 7800c34
Show file tree
Hide file tree
Showing 51 changed files with 2,036 additions and 1,812 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Trevas Tests

on:
pull_request:
types: [ opened, synchronize, reopened ]
types: [opened, synchronize, reopened]
branches:
- "!master"
- "!develop"
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: "adopt"
- name: Test
run: mvn test
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ on:
paths-ignore:
- "docs/**"
pull_request:
types: [ opened, synchronize, reopened ]
types: [opened, synchronize, reopened]
branches:
- 'master'
- 'develop'
- "master"
- "develop"

jobs:
build:
Expand All @@ -24,8 +24,8 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: "adopt"
- name: Test, package and analyze with maven & SonarCloud
run: mvn verify sonar:sonar -Dsonar.projectKey=InseeFr_Trevas -Dsonar.organization=inseefr -Dsonar.host.url=https://sonarcloud.io
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 11
distribution: "adopt"
java-version: "17"
distribution: "temurin"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
java-version: 17
distribution: "adopt"
- name: Publish package
run: mvn --batch-mode deploy
env:
Expand Down
15 changes: 14 additions & 1 deletion docs/docs/developer-guide/index-developer-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,31 @@ ScriptEngine engine = new ScriptEngineManager().getEngineByName("vtl");

// Add input bindings to engine
Bindings bindings = new SimpleBindings();
InMemoryDataset dataset = new InMemoryDataset(
List.of(
Map.of("var1", "x", "var2", "y", "var3", 5),
Map.of("var1", "xx", "var2", "yy", "var3", 10)
),
Map.of("var1", String.class, "var2", String.class, "var3", Long.class),
Map.of("var1", Role.IDENTIFIER, "var2", Role.ATTRIBUTE, "var3", Role.MEASURE)
);
bindings.put("a", 1);
bindings.put("ds", dataset);
engine.setBindings(b, ScriptContext.ENGINE_SCOPE);

// Execute script
try {
engine.eval("b := a + 1;");
engine.eval("b := a + 1; " +
"ds1 := ds;" +
"ds2 <- ds;");
} catch (VtlScriptException e) {
logger.warn("Eval failed: ", e);
}

// Get result
Long result = (Long) engine.getBindings(ScriptContext.ENGINE_SCOPE).get("b");
Dataset ds1 = (Dataset) engine.getBindings(ScriptContext.ENGINE_SCOPE).get("ds1");
PersistentDataset result = (PersistentDataset) engine.getBindings(ScriptContext.ENGINE_SCOPE).get("ds2");
```

### Execution mode
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user-guide/coverage/general-operators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ custom_edit_url: null
| Name | Symbol | Supported |
| -------------------------------------------------- | :----- | :----------------: |
| Parentheses | ( ) | :heavy_check_mark: |
| Persistent assignment | <- | :x: |
| Persistent assignment | <- | :heavy_check_mark: |
| Temporary assignment | := | :heavy_check_mark: |
| Membership | # | :heavy_check_mark: |
| User-defined operator call | | :heavy_check_mark: |
Expand Down
Loading

0 comments on commit 7800c34

Please sign in to comment.