ankane / blazer

Business intelligence made simple
MIT License
4.56k stars 474 forks source link

Blazer drops formating when query saved #399

Closed klarazetkin closed 2 years ago

klarazetkin commented 2 years ago

The problem is as follows. You write a query with formating.

image

Then you save or update the query. When you look at the saved query code it keeps formating.

image

But as soon as you start editing the query, the formating is dropped.

image

If a query is a complicated one, it's a pain. Very annoying. :(

ankane commented 2 years ago

Hey @klarazetkin, unfortunately, I'm not sure how to reproduce. What OS and browser are you using (including versions)?

klarazetkin commented 2 years ago

Hi, @ankane! I'm using Ubuntu 20.04 and Version 101.0.4951.64 (Official Build) snap (64-bit). I tried blazer with Firefox Browser 100.0.2 (64-bit) and the bug reproduced. Should I try some other browser, just Chrome maybe?

ankane commented 2 years ago

Trying other browsers would be helpful (if you have any Firefox extensions installed, try disabling those as well). Also, it'd be good to see how the statement is stored in the database.

Blazer::Query.find(query_id).statement
klarazetkin commented 2 years ago

Thank you, will try a different browser and will try disabling Firefox extensions. I probably should try to disable Chromium extensions as well, shouldn't I?

Also, it'd be good to see how the statement is stored in the database.

This query:

image

Looks this way in the database:

irb(main):019:0> Blazer::Query.find(query_id).statement
=> "SELECT AVG(avg_income) AS avg_income\r\nFROM (\r\n    SELECT SUM(avg_income) AS avg_income\r\n    FROM ad_units\r\n    WHERE deleted_at IS NULL\r\n    AND avg_income > 0\r\n    GROUP BY publisher_id\r\n) AS earning_publishers_income"
ankane commented 2 years ago

The database value looks good, so seems like something else is causing it.

ankane commented 2 years ago

Cleaning up issues. Seems like it may be specific to your installation, but will be on the lookout for similar reports.

klarazetkin commented 2 years ago

Hey-hey, sad to say, the issue remains. It's persistent with both Firefox and Chrome with all extensions disabled. Might it be connected to the way blazer is integrated into our application? Is there anything we can check on our side?