# Problem with data\_source.add\_query\_asset

**URL:** <https://discourse.greatexpectations.io/t/problem-with-data-source-add-query-asset/2290>\
**Category:** GX Core Support\
**Tags:** how-to, help-wanted\
**Created:** [August 27, 2025, 11:09am UTC](https://discourse.greatexpectations.io/t/problem-with-data-source-add-query-asset/2290 "2025-08-27T11:09:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![StacyStacy](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@StacyStacy](https://discourse.greatexpectations.io/u/StacyStacy)\
**Post date:** [August 27, 2025, 11:09am UTC](https://discourse.greatexpectations.io/t/problem-with-data-source-add-query-asset/2290/1 "2025-08-27T11:09:40Z")

</div>

Not work standart expectations

1. connection\_string = f"trino://{user}:{password}@{host}:{port}/{catalog}/{ **schema** }?verify=false&http\_scheme=https"

query\_asset = data\_source.add\_query\_asset(

name=asset\_name,

query=”select \* from my\_table”

)

then gx does not define correctly **schema** and **table\_name**  
i find in utils.py , problem in regular expression  
**`elif`** `dialect.name.lower() ` **`==`** `"trino":`

` ` **`try`** `:`

` table_name` **`=`** `selectable.name # type: ignore[attr-defined] # FIXME CoP`

` ` **`except`** `AttributeError:`

` print(f'selectable:{selectable}')`

` table_name` **`=`** `selectable`

` ` **`if`** `str(table_name).lower().startswith("select"):`

` rx` **`=`** `re.compile(r"^.* from ([\S]+)", re.I)`

` match` **`=`** `rx.match(str(table_name).replace("\n", ""))`

` ` **`if`** `match:`

` table_name` **`=`** `match.group(1)`

` schema_name` **`=`** `sqlalchemy_engine.dialect.default_schema_name`

` print(f"schema_name:{schema_name}")`

` print(f"table_name:{table_name}")`

selectable: SELECT \*  
FROM (SELECT \* FROM my\_table) AS anon\_1  
WHERE true  
schema\_name: my\_schema  
table\_name: my\_table\*\*)\*\*

---

<div class="post-metadata">

**Author:** ![StacyStacy](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@StacyStacy](https://discourse.greatexpectations.io/u/StacyStacy)\
**Post date:** [September 1, 2025, 6:49pm UTC](https://discourse.greatexpectations.io/t/problem-with-data-source-add-query-asset/2290/3 "2025-09-01T18:49:04Z")

</div>

> [@StacyStacy](#):
>
> also
> 
> If i use onnection\_string = f"trino://{user}:{password}@{host}:{port}/{catalog}/?verify=false&http\_scheme=https"
> 
> without schema and
> 
> ```auto
> query_asset = data_source.add_query_asset(
> name=asset_name,
> query=”select * from my_table”
> )
> 
> ```
> 
> then standart expectations don’t work  
> For exampe expect\_column\_values\_to\_not\_be\_null  
> because parser in utils not found scheme
> 
> GX trying to make a check for the existence of a column
> 
> I think this is a bug, and it should check the set returned by the sql script instead of trying to access the information schema.

also

If i use onnection\_string = f"trino://{user}:{password}@{host}:{port}/{catalog}/?verify=false&http\_scheme=https"

without schema and

```auto
query_asset = data_source.add_query_asset(
name=asset_name,
query=”select * from my_scheme.my_table”
)

```

then standart expectations don’t work  
For exampe expect\_column\_values\_to\_not\_be\_null  
because parser in utils not found scheme

GX trying to make a check for the existence of a column

I think this is a bug, and it should check the set returned by the sql script instead of trying to access the information schema.
