-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put filters in an array instead of flt strings
- Loading branch information
Showing
13 changed files
with
142 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"""update filters for slice model | ||
Revision ID: 53fc3de270ae | ||
Revises: db0c65b146bd | ||
Create Date: 2017-01-31 10:18:49.071296 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '53fc3de270ae' | ||
down_revision = 'db0c65b146bd' | ||
|
||
from alembic import op | ||
from superset import db, cast_filter_data | ||
import json | ||
from sqlalchemy.ext.declarative import declarative_base | ||
from sqlalchemy import Column, Integer, String, Text | ||
|
||
Base = declarative_base() | ||
|
||
|
||
class Slice(Base): | ||
"""Declarative class to do query in upgrade""" | ||
__tablename__ = 'slices' | ||
id = Column(Integer, primary_key=True) | ||
datasource_id = Column(Integer) | ||
druid_datasource_id = Column(Integer) | ||
table_id = Column(Integer) | ||
datasource_type = Column(String(200)) | ||
params = Column(Text) | ||
|
||
|
||
def upgrade(): | ||
bind = op.get_bind() | ||
session = db.Session(bind=bind) | ||
|
||
for slc in session.query(Slice).all(): | ||
d = json.loads(slc.params) | ||
d = cast_filter_data(d) | ||
slc.params = json.dumps(d) | ||
session.merge(slc) | ||
session.commit() | ||
session.close() | ||
|
||
|
||
def downgrade(): | ||
pass |
4 changes: 2 additions & 2 deletions
4
superset/migrations/versions/db0c65b146bd_update_slice_model_json.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.