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

Database Imports Not Working & SSH Tunnel Limitations #451

Draft
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

khelfen
Copy link
Collaborator

@khelfen khelfen commented Feb 6, 2025

Description

Please include a summary of the change and which issue is fixed.

Fixes #450 and #455

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • New and adjusted code is formatted using the pre-commit hooks
  • New and adjusted code includes type hinting now
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The Read the Docs documentation is compiling correctly
  • If new packages are needed, I added them the setup.py, and if needed the rtd_requirements.txt, the eDisGo_env.yml and the eDisGo_env_dev.yml.
  • I have added new features to the corresponding whatsnew file

@khelfen khelfen requested a review from joda9 February 12, 2025 14:41
khelfen and others added 5 commits February 12, 2025 15:53
…h improved handling for default token file and format validation
- Add `TOEP_TOKEN.*` to `.gitignore` to prevent accidental commits of sensitive tokens.
- Improve token retrieval logic in `edisgo/io/db.py`:
  - Use `importlib.util.find_spec` to locate the `edisgo` package directory dynamically.
  - Check for token existence before reading to avoid `FileNotFoundError`.
  - Improve logging for missing or invalid tokens, providing clearer warnings about potential connection issues.
- Ensure a more robust fallback mechanism when no valid token is found.
- Replaced direct use of copy.deepcopy with custom copy method in two places.
- Added a new `copy` method to the `EDisGo` class, supporting both shallow and deep copies while excluding the SQLAlchemy engine from being copied.
- Ensured proper restoration of the SQLAlchemy engine after copying.
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.

[BUG] Database Imports Not Working & SSH Tunnel Limitations
2 participants