Hi; question regarding SQLAlchemyTask — I was able...
# ask-the-community
g
Hi; question regarding SQLAlchemyTask — I was able to connect to postgres without issue, however I tried to connect to a MSSQL database using
pyodbc
, however it appears this is not available on the generic image that is user for those kinds of tasks. This makes sense given that this also requires a custom driver from MS to be installed to be useful. Is it possible to swap out the docker image for
SQLAlchemyTask
? If so, how should I extend or build a new docker image for use with MSSQL?
Also I think we should just simply improve the entire sqlalchemy plugin, Flyte's fast registration system makes the plugin even simpler (the existing plugin was build on some legacy interface) - not wrong, just can be simplified. cc @Samhita Alla
s
@Ketan (kumare3) could you elaborate more on how fast registration will make the plugin simpler?
k
You don’t need the template passing that we do today. We always have the code now when we fast register and simply installing the plugin with alchemy can solve the problem. Also we can do Similar to Spark where we can set the base image in imagespec
So the code is simply just execute
g
@Ketan (kumare3) busy resurrecting a thread here but relevant to past conversation: I’m trying to override
container_image
on the existing
SQLAlchemyTask
to use the image specified for the rest of the workflow, however I am getting an error like this:
Copy code
couldn't parse image reference "{{.images.default.fqn}}:{{.images.default.tag}}": invalid reference format
The errors above are returned from Kubernetes so it looks like the
SQLAlchemyTask
is not resolving the templates. Any idea how I can get
SQLAlchemyTask
to run with the image passed in with
--image
without hard coding it? My config follows:
Copy code
SQLAlchemyTask(
    "example.hello_mssql.sql_task",
    query_template="""
        SELECT @@version version
    """,
    container_image="{{.images.default.fqn}}:{{.images.default.tag}}",
    output_schema_type=DataSchema,
    task_config=SQLAlchemyConfig(
        ...
    ),
    secret_requests=[*secrets.values()],
)
s
placeholder string in the image isn't supported in sqlalchemytask. this needs to be wrapped in `get_registerable_container_image` method for that to work. not sure what the implications are.
g
I guess hard-coded it is for now…
k
That’s a big
Let’s fix it, should be trivial
Just return and call super
s
@Greg Linklater would you mind creating an issue? [flyte-core]
g
Will do