Feature/set preview limit#19
Conversation
…gger call in start_directory_watcher function feat(main.py): add logger instantiation in main function
|
Cool I'll take a deeper look at this on Monday! Thanks for the PR. Love that we're evolving this together :) |
| @@ -22,7 +24,6 @@ def start_streamlit() -> None: | |||
| subprocess.run(["streamlit", "run", streamlit_app_path]) | |||
|
|
|||
| def start_directory_watcher(path: str, log_queue: multiprocessing.Queue) -> None: | |||
There was a problem hiding this comment.
There was a problem hiding this comment.
Show me a screenshot where you're seeing duplicate logs
There was a problem hiding this comment.
My gut tells me this is a quirk using WSL. See if you can run this on linux using the github codespace.
There was a problem hiding this comment.
Which logs do you have in mind?
In the screenshots you're showing different parts of the output in different scenarios, one is failure and one is success.
If it's about 'dbt build' logs (I assume it's this one), then in the second one they're also visible ("Completed successfully").
If it's about the query & build time, they're not visible in case of failure independent of whether 'setup_logger' is added here or not.
There was a problem hiding this comment.
That's so interesting. I've never seen the duplicate logs before in my setup. This is affirming my point that something may be going on in WSL
There was a problem hiding this comment.
double checked in Codespace and the result is similar, instead of triplicating the log output, it's duplicated now (and without the setup_logger() in start_directory_watcher it runs correctly), super weird. I wonder how it's possible that on Mac you don't get the log outputs without the duplicated logging setup.
It's being called already in main() which should be enough for the logs to show up.
Here the screens
There was a problem hiding this comment.
I'll check on codespaces once you update the code for my review. I wouldn't be surprised if there's a confounding variable in my local setup that's preventing duplicates logs.
sungchun12
left a comment
There was a problem hiding this comment.
See my earlier feedback to refactor this and then I'll review it again!
Co-authored-by: Sung Won Chung <sungwonchung3@gmail.com>
Co-authored-by: Sung Won Chung <sungwonchung3@gmail.com>
|
I'm going to hold off on merging this until 4/19 because I want to present a couple wild features to my company on 4/18. I'll give you a shoutout for all your help! |
|
sounds good to me! thanks a lot for the shoutout :) I'm traveling at the moment so out of the working routine but will be back next week to make some more progress. good luck with the presentation! |
This is strange as well. It's working on WSL and it's working in Codespaces as well as expected. I'm still updating to your suggestion, it's indeed a bit cleaner |
refactor(query_handler.py): remove unused imports and variables, reformat code
| @@ -22,7 +24,6 @@ def start_streamlit() -> None: | |||
| subprocess.run(["streamlit", "run", streamlit_app_path]) | |||
|
|
|||
| def start_directory_watcher(path: str, log_queue: multiprocessing.Queue) -> None: | |||
There was a problem hiding this comment.
I'll check on codespaces once you update the code for my review. I wouldn't be surprised if there's a confounding variable in my local setup that's preventing duplicates logs.
- Add `rows_preview_limit` parameter to `start_directory_watcher` function in `main.py` - Add `rows_preview_limit` parameter to `DynamicQueryHandler` class in `query_handler.py` - Pass `rows_preview_limit` parameter to `handle_query` function in `query_handler.py` - Use `rows_preview_limit` parameter instead of `preview_limit_rows` variable in `handle_query` function in `query_handler.py`
|
Added a bunch of changes and should be ready for review. |
|
Lovely! I'll take a look this week and add comments! |
|
Can you show me a screenshot of this working? I can't get it to work at all with or without the preview flag: Please resolve the conflicts of the files above listed by Github! |
|
|
||
| @lru_cache(maxsize=128) | ||
| def execute_query(query: str, db_file: str) -> Tuple[List[Tuple[Any]], List[str]]: | ||
| def execute_query(query: str, db_file: str, limit:int = 5) -> Tuple[List[Tuple[Any]], List[str]]: |









Added the set preview limit, worked as far as I've tested it
Removed redundant call of setup_logger() as it was resulting in triplicated logging output. ie everything that was logged after it, was printed 3 times.