Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Was taking a look at https://docs.noteable.io/product-docs/work-with-notebooks/scheduling-and-orchestration/prefect.
Perhaps rather than having users add this to their flow:
# This can be skipped if you are already setting the env variable externally
token_block = Secret.load('noteable-token')
os.environ['NOTEABLE_TOKEN'] = token_block.get()
# Use this domain block if using a custom domain name for your Noteable deployment
#domain_block = Secret.load('noteable-domain')
#os.environ['NOTEABLE_DOMAIN'] = token_block.get()
I imagine a NoteableCredentials block
class NoteableCredentials(Block):
_block_type_logo = "" # noqa
token: SecretStr = Field(default=..., description="Token to authenticate with Noteable.")
domain: Optional[str] = Field(default=None, description="Noteable's notebook domain.")
def apply(self):
os.environ['NOTEABLE_TOKEN'] = self.token.get_secret_value()
if self.domain:
os.environ['NOTEABLE_DOMAIN'] = self.domain
Then an execute_notebook task:
from prefect import task
from prefect_jupyter import execute_notebook as execute
@task
def execute_notebook(noteable_credentials: NoteableCredentials, url: str, parameters: Dict[str, Any] = None, **execute_kwargs):
noteable_credentials.apply()
return execute(
path=url
parameters={"end_time": "12-15-22"},
engine_name="noteable",
**execute_kwargs
)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Was taking a look at https://docs.noteable.io/product-docs/work-with-notebooks/scheduling-and-orchestration/prefect.
Perhaps rather than having users add this to their flow:
I imagine a
NoteableCredentialsblockThen an execute_notebook task: