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/SK-938 | Fix KeyError for client_id #656

Merged
merged 4 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions .github/workflows/build-containers.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: "build containers"

on:
workflow_dispatch:
push:
branches:
- master
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/push-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Publish Python distribution to PyPI

on:
workflow_dispatch:
release:
types: [created]
types: published

jobs:
build-and-publish:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
author = "Scaleout Systems AB"

# The full version, including alpha/beta/rc tags
release = "0.11.0"
release = "0.11.1"

# Add any Sphinx extension module names here, as strings
extensions = [
Expand Down
8 changes: 7 additions & 1 deletion fedn/network/storage/statestore/mongostatestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,13 @@ def set_client(self, client_data):
:return:
"""
client_data["updated_at"] = str(datetime.now())
self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": client_data}, True)
try:
self.clients.update_one({"client_id": client_data["client_id"]}, {"$set": client_data}, True)
except KeyError:
# If client_id is not present, use name as identifier, for backwards compatibility
id = str(uuid.uuid4())
client_data["client_id"] = id
self.clients.update_one({"name": client_data["name"]}, {"$set": client_data}, True)

def get_client(self, client_id):
"""Get client by client_id.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "fedn"
version = "0.11.0"
version = "0.11.1"
description = "Scaleout Federated Learning"
authors = [{ name = "Scaleout Systems AB", email = "[email protected]" }]
readme = "README.rst"
Expand Down
Loading