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

Enhance code quality #6

Merged
merged 21 commits into from
May 31, 2024

Commits on May 29, 2024

  1. Improve docstrings.

    - Fix typos.
    - Fix broken links.
    - Improve readability.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    c45a504 View commit details
    Browse the repository at this point in the history
  2. Filter undesirable special members from autodoc.

    Update conf.py with functionalities to specify which special members have to be kept in the documentation.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    2a5f8a1 View commit details
    Browse the repository at this point in the history
  3. Fix a typo.

    The name of the `pipelines` module was mistakenly spelled as `piplines`.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    abc8a32 View commit details
    Browse the repository at this point in the history
  4. Replace the term mock with test

    There were several places that we had used `mock data` to refer to data generated for testing purposes. This was misleading as we are actually generating the data and the API calls are not mocked. Example `mock_database` is renamed to `test_database`.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    603b02f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    55915f9 View commit details
    Browse the repository at this point in the history
  6. Add more tests for the queries route

    As a result, `test_utils` and the `queries` route handler have been also updated.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    9ee2e60 View commit details
    Browse the repository at this point in the history
  7. Log insertion and deletion

    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    409df77 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    76fe40e View commit details
    Browse the repository at this point in the history
  9. Update API to use new query annotations

    The new version of FastAPI recommends using `Annotated` for queries. This also resolves the issue with ruff complaining about `Query(None)`.
    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    c00a7a6 View commit details
    Browse the repository at this point in the history
  10. Improve type hints

    pkhalaj committed May 29, 2024
    Configuration menu
    Copy the full SHA
    a4298f5 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2024

  1. Improve type checks and validation using Pydantic

    This led to the removal of some redundant type checks.
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    f0c7e16 View commit details
    Browse the repository at this point in the history
  2. Fix a bug and add a log message

    The bug had to do with multiple deletion in the recorder. The log message was added to the auto exception handler.
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    825bff7 View commit details
    Browse the repository at this point in the history
  3. Simplify test_utils.TestDatabase.match_query()

    Add two auxiliary methods which simplify the implementation of the main method.
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    5ab9e27 View commit details
    Browse the repository at this point in the history
  4. Extract a function to make a single query string in test_api

    The function is named `make_query_string`
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    fb78e7c View commit details
    Browse the repository at this point in the history
  5. Change the signature of parse_config

    The old name of the function was `parse_config_yaml_file`. The function now accepts a number of different types for the input arg `file`.
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    91aebe2 View commit details
    Browse the repository at this point in the history
  6. Add @logger.catch to the run_server function

    This logs and catches unhandled exceptions.
    pkhalaj committed May 30, 2024
    Configuration menu
    Copy the full SHA
    598b09f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    95f9de6 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2024

  1. Amend parse_config()

    - Remove type hint for `file`.
    - Amend docstring.
    - Remove explicit exception handling for parsing and reading the file.
    pkhalaj committed May 31, 2024
    Configuration menu
    Copy the full SHA
    89ccff0 View commit details
    Browse the repository at this point in the history
  2. Remove type checks for config in api.py

    As a result, the signature of `run_server()` and
    `api_server_process_context()` have been changed.
    They now only accept a `config` object of type
    `AppConfig`.
    pkhalaj committed May 31, 2024
    Configuration menu
    Copy the full SHA
    506f122 View commit details
    Browse the repository at this point in the history
  3. Reorder functions in test scripts.

    The dependencies are now brought after the first main dependent function that uses them.
    pkhalaj committed May 31, 2024
    Configuration menu
    Copy the full SHA
    c42f8cc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    781891d View commit details
    Browse the repository at this point in the history