Skip to content

Commit

Permalink
chore: update deprecated arguments in schema (#24715)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianliebscher authored Jul 18, 2023
1 parent b7dcc9f commit 11bb8c3
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions superset/row_level_security/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,52 +50,54 @@ class TablesSchema(Schema):


class RLSListSchema(Schema):
id = fields.Integer(description=id_description)
name = fields.String(description=name_description)
id = fields.Integer(metadata={"description": "id_description"})
name = fields.String(metadata={"description": "name_description"})
filter_type = fields.String(
description=filter_type_description,
metadata={"description": "filter_type_description"},
validate=OneOf(
[filter_type.value for filter_type in RowLevelSecurityFilterType]
),
)
roles = fields.List(fields.Nested(RolesSchema))
tables = fields.List(fields.Nested(TablesSchema))
clause = fields.String(description=clause_description)
clause = fields.String(metadata={"description": "clause_description"})
changed_on_delta_humanized = fields.Function(
RowLevelSecurityFilter.created_on_delta_humanized
)
group_key = fields.String(description=group_key_description)
description = fields.String(description=description_description)
group_key = fields.String(metadata={"description": "group_key_description"})
description = fields.String(metadata={"description": "description_description"})


class RLSShowSchema(Schema):
id = fields.Integer(description=id_description)
name = fields.String(description=name_description)
id = fields.Integer(metadata={"description": "id_description"})
name = fields.String(metadata={"description": "name_description"})
filter_type = fields.String(
description=filter_type_description,
metadata={"description": "filter_type_description"},
validate=OneOf(
[filter_type.value for filter_type in RowLevelSecurityFilterType]
),
)
roles = fields.List(fields.Nested(RolesSchema))
tables = fields.List(fields.Nested(TablesSchema))
clause = fields.String(description=clause_description)
group_key = fields.String(description=group_key_description)
description = fields.String(description=description_description)
clause = fields.String(metadata={"description": "clause_description"})
group_key = fields.String(metadata={"description": "group_key_description"})
description = fields.String(metadata={"description": "description_description"})


class RLSPostSchema(Schema):
name = fields.String(
description=name_description,
metadata={"description": "name_description"},
required=True,
allow_none=False,
validate=Length(1, 255),
)
description = fields.String(
description=description_description, required=False, allow_none=True
metadata={"description": "description_description"},
required=False,
allow_none=True,
)
filter_type = fields.String(
description=filter_type_description,
metadata={"description": "filter_type_description"},
required=True,
allow_none=False,
validate=OneOf(
Expand All @@ -104,34 +106,41 @@ class RLSPostSchema(Schema):
)
tables = fields.List(
fields.Integer(),
description=tables_description,
metadata={"description": "tables_description"},
required=True,
allow_none=False,
validate=Length(1),
)
roles = fields.List(
fields.Integer(), description=roles_description, required=True, allow_none=False
fields.Integer(),
metadata={"description": "roles_description"},
required=True,
allow_none=False,
)
group_key = fields.String(
description=group_key_description, required=False, allow_none=True
metadata={"description": "group_key_description"},
required=False,
allow_none=True,
)
clause = fields.String(
description=clause_description, required=True, allow_none=False
metadata={"description": "clause_description"}, required=True, allow_none=False
)


class RLSPutSchema(Schema):
name = fields.String(
description=name_description,
metadata={"description": "name_description"},
required=False,
allow_none=False,
validate=Length(1, 255),
)
description = fields.String(
description=description_description, required=False, allow_none=True
metadata={"description": "description_description"},
required=False,
allow_none=True,
)
filter_type = fields.String(
description=filter_type_description,
metadata={"description": "filter_type_description"},
required=False,
allow_none=False,
validate=OneOf(
Expand All @@ -140,19 +149,21 @@ class RLSPutSchema(Schema):
)
tables = fields.List(
fields.Integer(),
description=tables_description,
metadata={"description": "tables_description"},
required=False,
allow_none=False,
)
roles = fields.List(
fields.Integer(),
description=roles_description,
metadata={"description": "roles_description"},
required=False,
allow_none=False,
)
group_key = fields.String(
description=group_key_description, required=False, allow_none=True
metadata={"description": "group_key_description"},
required=False,
allow_none=True,
)
clause = fields.String(
description=clause_description, required=False, allow_none=False
metadata={"description": "clause_description"}, required=False, allow_none=False
)

0 comments on commit 11bb8c3

Please sign in to comment.