Skip to content

Commit

Permalink
Merge pull request #13 from glencoesoftware/annotation_return
Browse files Browse the repository at this point in the history
Return FileAnnotation ID when creating table, not OriginalFile ID
  • Loading branch information
emilroz authored Feb 8, 2024
2 parents 27bbe10 + 3ec1a42 commit bf45593
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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 @@ -129,13 +129,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()

0 comments on commit bf45593

Please sign in to comment.