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

[Bug fix]: CLI overwriting an app does not update configuration #1863 #1866

Merged
merged 4 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion agenta-backend/agenta_backend/services/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,10 @@ async def update_variant_parameters(
raise NoResultFound(f"App variant with id {app_variant_id} not found")

# Update associated ConfigDB parameters
app_variant_db.config_parameters.update(parameters)
if parameters == {}:
app_variant_db.config_parameters = {}
else:
app_variant_db.config_parameters.update(parameters)

# ...and variant versioning
app_variant_db.revision += 1 # type: ignore
Expand Down
6 changes: 4 additions & 2 deletions agenta-cli/agenta/sdk/agenta_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,17 @@ def init(


class Config:
def __init__(self, base_id: str, host: str, api_key: str = ""):
def __init__(self, base_id: str, host: str, api_key: Optional[str]):
mmabrouk marked this conversation as resolved.
Show resolved Hide resolved
self.base_id = base_id
self.host = host

if base_id is None or host is None:
self.persist = False
else:
self.persist = True
self.client = AgentaApi(base_url=self.host + "/api", api_key=api_key)
self.client = AgentaApi(
base_url=self.host + "/api", api_key=api_key if api_key else ""
)

def register_default(self, overwrite=False, **kwargs):
"""alias for default"""
Expand Down
Loading