Is there a way to use a `DictCursor` with the exis...
# ask-community
a
Is there a way to use a
DictCursor
with the existing
SnowflakeQuery
task? The source shows
Copy code
try:
            with conn:
                with conn.cursor() as cursor:
                    executed = cursor.execute(query, params=data).fetchall()
            conn.close()
            return executed
while what I would want to use is:
Copy code
try:
            with conn:
                with conn.cursor(DictCursor) as cursor:
                    executed = cursor.execute(query, params=data).fetchall()
            conn.close()
            return executed
Has anyone else dealt with this before? I’d like to simply inject the DictCursor class if possible, but from the way this block of code is written it looks like the only way to do it is to subclass
SnowflakeQuery
and overwrite the entire
run
method.
1
k
Hey @Austen Bouza, I think subclassing the
SnowflakeQuery
task and overwriting the run method would be the way to go here unfortunately. I haven't seen anyone else deal with this, but you can open a feature request with more details if you want.
a
@Kevin Kho thanks, that’s what I gathered from going through the source code. Just submitted a new issue here. Also happy to submit a PR if the team is open to reviewing one.