Conversation
|
In your post, you just had it return the max phase. Here, it look like you're adding a filter. I think a different way to do this is to just add a boolean flag for returning max phase and then format it in to the SELECT part of the query instead of the WHERE part |
jhylin
left a comment
There was a problem hiding this comment.
Oops yes, that was acting like a filter, I've changed it into a boolean flag (leaving it as False as default, and can be toggled on if set to True), and added it into the string code section, and also the actual SQL part. Is this better?
1. Just check bools directly in if/else 2. No need for f-string 3. Stick the format in the middle to get around the trailing comma issue.
|
Yes, I just did a unittest on the latest code (I've pushed the test_queries.py in the /test folder), and it worked. The only thing was (very likely due to my lack of experience in doing unittest), I had to temporarily make target_id as Optional[str], and the test passed - unsure how I would resolve the error message regarding "missing 1 positional statement for target_id" in the unittest if I didn't make it optional? |
|
@jhylin the trick was that you were missing the |
This PR is related to this issue #1, many thanks.