In working with PydanticDTO from litestar, realized that columns with secret=True parameter were not being added to Table._meta.secret_columns
Seems like a relatively small change:
# piccolo/table.py
# line 85 -> update type from Secret to Column to support any Column type as secret_column
secret_columns: t.List[Column] = field(default_factory=list)
# line 271 -> update type from Secret to Column any Column type as secret_column
secret_columns: t.List[Column] = []
# line 311 -> add check for secret param
if isinstance(column, Secret) or column._meta.secret:
secret_columns.append(column)
With new test:
# tests/table/test_metaclass.py
def test_secret_columns_with_param(self):
"""
Make sure TableMeta.secret_columns include columns with `secret=True`
"""
class Classified(Table):
top_secret = Varchar(secret=True)
self.assertEqual(
Classified._meta.secret_columns, [Classified.top_secret]
In working with
PydanticDTO
from litestar, realized that columns withsecret=True
parameter were not being added toTable._meta.secret_columns
Seems like a relatively small change:
With new test:
Changes staged for PR here.