Skip to content

Automatically resolve pathlib.Path types in AppConfig#83

Merged
gpauloski merged 4 commits intomainfrom
issue-44
Jul 5, 2024
Merged

Automatically resolve pathlib.Path types in AppConfig#83
gpauloski merged 4 commits intomainfrom
issue-44

Conversation

@gpauloski
Copy link
Copy Markdown
Contributor

Description

Automatically resolve pathlib.Path types in AppConfig so that absolute paths are created on initialization. This removes the need for the custom field validators to avoid unexpected relative path failures when taps.run changes the CWD to the run_dir.

Fixes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (internal implementation changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (no changes to the code)
  • CI change (changes to CI workflows, packages, templates, etc.)
  • Version changes (changes to the package or dependency versions)

Testing

Added tests, and testing with the fedlearn app.

Pull Request Checklist

Please confirm the PR meets the following requirements.

  • Relevant tags are added (breaking, bug, dependencies, documentation, enhancement, refactor).
  • Code changes pass pre-commit (e.g., ruff, mypy, etc.).
  • Tests have been added to show the fix is effective or that the new feature works.
  • New and existing unit tests pass locally with the changes.
  • Docs have been updated and reviewed if relevant.

gpauloski added 4 commits July 5, 2024 14:17
This test assumes the task callbacks that log the task records will run
in the same order the tasks were submitted. This is not the case, so it
is not guarenteed the record for the second task will be second in the
records list.
Forbidding extra options in the engine plugin configs (executor, filter,
and transformer) meant that trying to override the plugin type defined
in a config file from a CLI argument would raise an "extra options
forbidden" error by the pydantic validators because of the options for
the not used plugin variant in the config.

This change should support that use case. Note that the run Config and
AppConfig still forbid extra options as a sanity check, and those don't
have the same issue of wanting to frequently switch the plugin type.
@gpauloski gpauloski added the enhancement New features or improvements to existing functionality label Jul 5, 2024
@gpauloski gpauloski merged commit 993459f into main Jul 5, 2024
@gpauloski gpauloski deleted the issue-44 branch July 5, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or improvements to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Determine how to handle relative filepaths

1 participant