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

#19 move slc notebook #122

Merged
merged 19 commits into from
Jul 19, 2024
Merged

#19 move slc notebook #122

merged 19 commits into from
Jul 19, 2024

Conversation

tomuben
Copy link
Contributor

@tomuben tomuben commented Jul 12, 2024

related to exasol/ai-lab#19

  1. Added a helper function open_pyexasol_connection_with_lang_definitions in language_container_activation.py which creates a pyexasol connection and applies ALTER SESSION command with all registered languages
  2. added slct_manager which provides a wrapper for exaslct commands used in the script_languages_container notebooks
  3. Added exasol-script-languages-container-tool as dependency

exasol/nb_connector/slct_manager.py Outdated Show resolved Hide resolved
test/integration/test_itde_manager_in_docker_container.py Outdated Show resolved Hide resolved
test/integration/test_slct_manager.py Show resolved Hide resolved
test/integration/test_slct_manager.py Show resolved Hide resolved
Nicoretti
Nicoretti previously approved these changes Jul 15, 2024
Nicoretti
Nicoretti previously approved these changes Jul 15, 2024
Nicoretti
Nicoretti previously approved these changes Jul 16, 2024
@tomuben tomuben force-pushed the feature/19_move_slc_notebook branch 2 times, most recently from 665ce3c to e0957f9 Compare July 18, 2024 17:24
@tomuben tomuben force-pushed the feature/19_move_slc_notebook branch from e0957f9 to 2be5218 Compare July 19, 2024 10:32
Comment on lines +55 to +63
@contextlib.contextmanager
def enter(self):
"""Changes working directory and returns to previous on exit."""
prev_cwd = Path.cwd()
os.chdir(self.root_dir)
try:
yield
finally:
os.chdir(prev_cwd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with python 3.11 there is a ready to go context manager for changing the dir is available see (https://docs.python.org/3/library/contextlib.html#contextlib.chdir)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know. Thx

ctx.emit("success")
/
""")
con = open_pyexasol_connection_with_lang_definitions(slc_secrets, schema='TEST')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having a connection fixture would be a possible simiplification

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not work in this case, as I have these dependencies to the other tests.

@tomuben tomuben merged commit ac64e47 into main Jul 19, 2024
9 checks passed
@tomuben tomuben deleted the feature/19_move_slc_notebook branch July 19, 2024 13:30
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.

2 participants