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

Return FileAnnotation ID when creating table, not OriginalFile ID #13

Merged
merged 1 commit into from
Feb 8, 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
2 changes: 1 addition & 1 deletion omero2pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def upload_table(dataframe, table_name, parent_id, parent_type='Image',
:param port: Port the server runs on (default 4064)
:param username: Username for server login
:param password: Password for server login
:return: File annotation ID of the new table
:return: File Annotation ID of the new table
"""
with OMEROConnection(server=server, username=username, password=password,
port=port, client=omero_connector) as connector:
Expand Down
6 changes: 3 additions & 3 deletions omero2pandas/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ def create_table(df, table_name, parent_id, parent_type, conn, chunk_size):
annotation.file = orig_file

link_obj.link(target_obj, annotation)
conn.getUpdateService().saveObject(link_obj, _ctx={
"omero.group": str(parent_group)})
link_obj = conn.getUpdateService().saveAndReturnObject(
link_obj, _ctx={"omero.group": str(parent_group)})
LOGGER.info("Saved annotation link")

LOGGER.info(f"Finished creating table {table_name} under "
f"{parent_type} {parent_id}")
return orig_file.id.val
return link_obj.child.id.val
finally:
if table is not None:
table.close()
Loading