Closed lmcmicu closed 2 years ago
@beckyjackson please look at get_matching_values(config, table_name, column_name, leading_string="")
in validate.py
and let me know if the function signature will work for you or if it needs to be tweaked.
Maybe I'm missing something, but I'm not able to get results from get_matching_values
(just returns an empty list). I had to replace the code on lines 399-436 with what you sent me in Slack to get around multiprocessing, so maybe I'm missing a part of the loading.
Here's what I'm trying just to test getting values from the table
column of the table
table:
data = get_matching_values(config, "table", "table")
Hi Becky, for the example you mentioned:
data = get_matching_values(config, "table", "table")
this will not return anything because the datatype is not defined in terms of an in()
condition. See the issue description here: https://github.com/jamesaoverton/cmi-pb-terminology/issues/51#issue-1140116403
We are only returning values for:
As for table_name
, it is defined in the datatype
table as exclude(/\W/)
To turn off the multiprocessing, set the MULTIPROCESSING
flag to False (at this line). Sorry I should have set it to False by default. I'll do that now.
Thanks - I got it working with Typeahead so the output looks good to me.
Converting to draft since we need to modify the get_matching_values() function. Instead of only matching on values that begin with the given string parameter, we need to match on values that contain that parameter as a substring (which can be anywhere in the value). We should also perform the match in SQL instead of python. See this issue comment for more info.
@beckyjackson We are no longer wrapping SQL JSON value with json(...)
(which was a mistake I didn't understand/notice), so lines like this https://github.com/ontodev/sprocket/blob/standalone-table/sprocket/render.py#L262 metadata = json.loads(meta[5:-1])
should be changed to metadata = json.loads(meta)
Closes #51, closes #52 (please close them manually since this PR is not going into master).