Skip to content

Dummy sets_stats_df if sets is not None but is empty#1

Open
JoeRibeiro wants to merge 1 commit into
ecotaxa:mainfrom
JoeRibeiro:main
Open

Dummy sets_stats_df if sets is not None but is empty#1
JoeRibeiro wants to merge 1 commit into
ecotaxa:mainfrom
JoeRibeiro:main

Conversation

@JoeRibeiro
Copy link
Copy Markdown

Hi @jiho

Amy & I at Cefas tested on a file with no defined sets and the converted_data.json came out containing:

"set_information": {
"definition": "",
"statistics": []
},

It tripped up causing the error:

Error processing 'converted_data.json': cannot access local variable 'sets_stats_df' where it is not associated with a value

Because set_information was present as an empty dictionary (not none) and sets_stats_df is only created inside the loop over set_information["statistics"]

This small fix seemed to unstick things. Cheers,
Joe

@jiho
Copy link
Copy Markdown
Collaborator

jiho commented Apr 24, 2026

I think the key here is that the test if sets is None is not the correct one. It should be None or of length 0. Can you please send and example file where this fails to that I can reproduce it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants