-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#245: Implemented support for Json for language definition
- Loading branch information
Showing
11 changed files
with
559 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ t.b.d. | |
|
||
## Features | ||
|
||
n/a | ||
- #245: Implemented support for Json for language definition | ||
|
||
## Refactoring | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from dataclasses import dataclass | ||
from enum import Enum | ||
from pathlib import PurePosixPath | ||
from typing import List | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class SLCLanguage(str, Enum): | ||
Java = "java" | ||
Python3 = "python" | ||
R = "r" | ||
|
||
|
||
class SLCParameter(BaseModel): | ||
""" | ||
Key value pair of a parameter passed to the Udf client. For example: `lang=java` | ||
""" | ||
|
||
key: str | ||
value: List[str] | ||
|
||
|
||
class UdfClientRelativePath(BaseModel): | ||
""" | ||
Path to the udf client relative to the Script Languages Container root path. | ||
For example `/exaudf/exaudfclient_py3` | ||
""" | ||
|
||
executable: PurePosixPath | ||
|
||
def __str__(self) -> str: | ||
return str(self.executable) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from dataclasses import dataclass | ||
from typing import Annotated, List | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
from exasol.slc.models.language_definition_common import ( | ||
SLCLanguage, | ||
SLCParameter, | ||
UdfClientRelativePath, | ||
) | ||
|
||
|
||
class LanguageDefinition(BaseModel): | ||
""" | ||
Contains information about a supported language and the respective path of the UDF client of an Script-Languages-Container. | ||
""" | ||
|
||
protocol: str | ||
default_alias: str | ||
language: SLCLanguage | ||
parameters: List[SLCParameter] | ||
udf_client_path: UdfClientRelativePath | ||
|
||
|
||
class LanguageDefinitionsModel(BaseModel): | ||
""" | ||
Contains information about all supported languages and the respective path of the UDF client of an Script-Languages-Container. | ||
""" | ||
|
||
language_definitions: List[LanguageDefinition] |
Oops, something went wrong.