exasol / python-extension-common Goto Github PK
View Code? Open in Web Editor NEWCommon functionality, shared by Exasol Python Extensions.
License: MIT License
Common functionality, shared by Exasol Python Extensions.
License: MIT License
At the moment when a deployer wants to wait for completion, it always tries to create a temporary schema. This is not possible if the user has no permission for that. In such a case the wait_for_completion
option has to be disabled. It would be useful to disable the temporary schema but still do the wait_for_completion
using the current schema. Maybe delete the dummy UDF when finished.
Add comment to tests and developer guide about using fixtures from pytest-plugin pytest-exasol-saas
test_saas/conftext.py
doc/developer_guide/developer-guide.rst
We don't always want to see the activation commands printed in the console. In particular, in AI-Lab they may confuse the user. She may think that they are still part of the installation routine, while the AI-Lab runs the session level activation when it opens a DB connection.
Ticket #42 requested to enhance the SLC Deployer, to optionally wait until SLC is deployed to all nodes in the database cluster. This is implemented by verifying the existence of file exasol-manifest.json
, which was added to all SLCS in the scope of ticket exasol/script-languages-container-tool#221.
It turned out that the integration tests of PEC failed, caused by using an SLC release not yet containing a manifest.
The developers decided to temporarily use the file /exaudf/exaudfclient_py3
as a workaround. This doesn't make PEC worse than before but will not provide enhanced validation.
The current ticket requests to replace the filename, again, as soon as the next release of script-languages-release is available, using an update version of SLCT to provide the file exasol-manifest.json
.
Another option would be to
ExtractValidator
Building the SLC is probably already implemented in a pytest fixture in the scope of ticket #45.
In the scope of ticket #50 a new ExtractValidator
has been implemented.
The current ticket requests adding options to the CLI so that an interactive user can control the timeout duration.
Migrate the SLC deployer integration tests from the TE or the SageMaker extension. Deploy a container from the SLC-release.
Multiple integration tests use the same instance of the DockerDb. Most tests upload an SLC to the bucketfs of the ITDE. Currently, we have interference between tests, as the containers uploaded by previous tests are not removed.
Removing a container has side effects.
Update
pyproject.toml
poetry update
.github/workflows
: Proposal: Update PTB and re-generate workflowsThe function needs to take a union set of parameters required for an on-prem and saas db. It should then infer which database to connect to.
Use the PathLike interface to connect to the bucketfs and upload SLC there.
Accommodate both on-prem and SaaS bucketfs.
This is the code that should be deleted:
ARCHIVE_EXTENSIONS = [".tar.gz", ".tgz", ".zip", ".tar"]
for extension in ARCHIVE_EXTENSIONS:
if bucket_file.endswith(extension):
bucket_file = bucket_file[: -len(extension)]
break
It seems that executing a code with the temp_schema context manager closes the currently open schema.
ExtractValidator
has been implemented as requested by #50LanguageContainerDeployer
as requested by #49The current ticket additionally requests converting the CLI tests for the SLC deployer to unit tests with mock.
In the scope of ticket #52, we want to add CLI options for the timeout settings.
The function should try to create a UDF and run it at all nodes. These steps need to be repeated until success or timeout.
Since the success is not 100% reliable proof that all files have been extracted from the archive, (some packages, not used by the UDF, may yet be extracted) the function should take a fixed time pause at the end.
The LanguageContainerDeployer should use this function in its container uploading process.
The release workflow for the python-extension-common doesn't finish cleanly. It fails in the report.yml at the attempt to copy the coverage, as shown here.
A temporary solution is to disable the report.yml by commenting out the calls to it in ci.yml and ci-cd.yml.
Repository advanced-analytics-framework already contains classes
The current ticket requests to move these classes to the current repo in order to enable using the classes in tests in other repositories as well.
A new ExtractValidator
has been implemented and integrated into class LanguageContainerDeployer
in the scope of tickets #50 and #49.
The current ticket additionally requests checking the existing integration tests of the SLC Deployer
manifest.json
to be extracted from the SLC
time.monotonic()
in tests involving tenacity Retrys.LanguageContainerDeployer
with temp_schema(self._pyexasol_conn) as schema:
GROUP BY IPROC()
name = re.sub(r"\.(tar|tar\.gz|zip|gzip)$", "", file_path.name)
manifest = file_path.parent / name / "exasol-manifest.json"
udf_path = manifest.as_udf_path()
--/
CREATE OR REPLACE PYTHON3 SCALAR SCRIPT manifest(my_path VARCHAR(256)) RETURNS BOOL AS
import os
def run(ctx):
return os.path.isfile(ctx.my_path)
/
After uploading file sample.tar.gz
:
SELECT iproc() "Node", manifest('/buckets/uploads/default/sample/exasol-manifest.json') "Manifest"
from values between 0 and 5 group by iproc();
NODE | MANIFEST |
---|---|
0 | true |
1 | true |
2 | true |
3 | true |
try:
for attempt in Retrying(stop=stop_after_attempt(3)):
with attempt:
raise Exception(‘My code is failing!’)
except RetryError:
pass
There are multiple problems with the dummy udf in the language_container_validation.py
.
Firstly, it needs to be a set UDF. Secondly, the way it is called doesn't actually make it run on all nodes.
The proposed change:
CREATE OR REPLACE {language_alias} SET SCRIPT {udf_name}(i DECIMAL(10, 0))
RETURNS DECIMAL(10, 0) AS
def run(ctx):
return ctx.i
/
Then call this udf like this:
SELECT NPROC();
SELECT {udf_name}(i) FROM VALUES BETWEEN 1 AND {num_nodes} t(i) GROUP BY i;
Initially, the language container deployment documentation can be taken from the Transformers extension repo.
In the scope of ticket #50 a new ExtractValidator
has been implemented.
The current ticket requests
ExtractValidator
into LanguageContainerDeployer
.LanguageContainerDeployer
to allow specifying the timeoutspytest-exasol-saas
The options' attributes should be set as it is described in the click options API documentation
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.