Skip to content

[GSK-1783] Fix issues due to pydantic compatibility migration#1421

Merged
Inokinoki merged 2 commits intomainfrom
feature/gsk-1783-fix-b21-pydantic
Sep 25, 2023
Merged

[GSK-1783] Fix issues due to pydantic compatibility migration#1421
Inokinoki merged 2 commits intomainfrom
feature/gsk-1783-fix-b21-pydantic

Conversation

@Inokinoki
Copy link
Copy Markdown
Member

@Inokinoki Inokinoki commented Sep 22, 2023

Description

  • AnyHttpUrl API becomes read-only and arg constructor is changed;
  • AnyHttpUrl cannot be implicitly considered as a string;
  • pydantic v2 has more strict validations on Optional fields.

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've updated the code style using make codestyle.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.

@linear
Copy link
Copy Markdown

linear Bot commented Sep 22, 2023

GSK-1783 Fix b21 worker connection issue

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/cli.py", line 31, in <module>
    cli(auto_envvar_prefix="GSK")
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/cli_utils.py", line 35, in wrapper
    return func(*args, **kwargs)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/commands/cli_worker.py", line 59, in wrapper
    return func(*args, **kwargs)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/commands/cli_worker.py", line 106, in start_command
    _start_command(is_server, url, api_key, is_daemon, hf_token)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/commands/cli_worker.py", line 157, in _start_command
    ml_worker = MLWorker(is_server, url, api_key, hf_token)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/ml_worker/ml_worker.py", line 43, in __init__
    ws_conn = self._create_websocket_client(backend_url, is_server, hf_token)
  File "/opt/giskard/internal-mlworker-venv/lib/python3.10/site-packages/giskard/ml_worker/ml_worker.py", line 56, in _create_websocket_client
    backend_url = AnyHttpUrl(
  File "/usr/local/lib/python3.10/typing.py", line 957, in __call__
    result = self.__origin__(*args, **kwargs)
TypeError: Url.__new__() got an unexpected keyword argument 'scheme'

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Inokinoki Inokinoki merged commit 28aa09a into main Sep 25, 2023
@Inokinoki Inokinoki deleted the feature/gsk-1783-fix-b21-pydantic branch September 25, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants