john-bodley opened a new pull request #4655: [druid] Updating refresh logic URL: https://github.com/apache/incubator-superset/pull/4655 Though the term "refresh" is somewhat vague from a Druid metadata perspective I sense this translates to create or update. Previously we were creating or updates Druid columns but only creating Druid metrics when the Druid metadata was synced/refreshed. This PR ensures that refreshing is consistent for both Druid columns and metrics and specifically addresses the following: 1. Removes redundancy by only controlling metric specifications within the `DruidMetric` class. Previously there was somewhat duplicate logic for both the `DruidColumn` and `DruidMetric` class. 2. Renames `generate_metrics` with `refresh_metrics` to imply that we're both creating and updating. 3. Updates the SQL filters to use `IN` rather than a series of `OR`s. 4. Adds the missing migration for creating Druid uniqueness constraints to the `columns` and `metrics` tables which were added in https://github.com/apache/incubator-superset/pull/3978. 5. Corrects the `--merge` options for the `refresh_druid` command, which should be a flag (true/false) rather than an option. 6. Note I didn't want to change the structure of `get_metrics` in terms of checking whether said metric already exists to ensure consistency with SQLA, hence why the merging logic is handled in `refresh_metrics`. @fabianmenges I only added the missing Druid migrations however I believe there are additional migrations from your PR (https://github.com/apache/incubator-superset/pull/3978) which are missing for the following tables: - `table_columns` - `tables` to: @mistercrunch @Mogball
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
