https://prefect.io logo
Title
p

Paco Ibañez

10/27/2022, 5:09 PM
Hello again! is there a way to not display flow run parameters of type pydantic.SecretStr in the UI?
looks like the model is properly defined. This is on 2.6.4
n

Nate

10/27/2022, 6:52 PM
hmm values of type SecretStr should already be masked in the UI what type of field are you showing in the last screencap?
p

Paco Ibañez

10/27/2022, 7:07 PM
the first screenshot shows the type of field
storage_config
from the deployment. the second scheenshot is how the storage_config field is rendered in the UI
class CsvSourceWithSecrets(BaseModel):
    url: str
    has_header: Optional[bool] = True
    encoding: Optional[str] = None
    escape_char: Optional[str] = None
    storage_config: Optional[SecretStr] = "{}"
isnt there another way of doing it? the package where I define these schemas does not import prefect
n

Nate

10/27/2022, 7:21 PM
wait - maybe I missed something here, are you trying to mask specific sections of the parameters field for a given flow run?
p

Paco Ibañez

10/27/2022, 7:21 PM
yes
but i define the flow schemas in a separate pkg with all my business logic
n

Nate

10/27/2022, 7:22 PM
ok then my first suggestion doesn't make sense let me check if we can accomplish this
p

Paco Ibañez

10/27/2022, 7:22 PM
thanks so much!
n

Nate

10/27/2022, 9:47 PM
Hi @Paco Ibañez - I haven't forgotten about this! I believe there might be a slight bug hiding here and I'm working with the rest of the team to figure it out if you happen to need masked parameters for only subflows, that should work fine now as shown here - otherwise I'll get back to you in this thread when I know something concrete
p

Paco Ibañez

10/27/2022, 9:55 PM
Ideally I would need secrets masked for both flows and subflows. Thanks a lot for your help!
👍 1
n

Nate

10/27/2022, 10:26 PM
in the meantime, would it make sense to just store your secret strings in Secret blocks and just pass the name of the secret block as a
str
parameter to the flow?
🙌 2
p

Paco Ibañez

10/28/2022, 2:13 PM
sounds good. thanks for your help!
👍 1