Akira Chang
04/18/2023, 1:10 PMbq_op_for_queries
for querying through BigQuery? I couldn't find any documentation about it, would I get the result of my query directly if I use this API?Tim Castillo
04/18/2023, 1:13 PMOut
for it. https://github.com/dagster-io/dagster/blob/7fab1f785a6a6de5219b6b43f26f4c7f7fa035fc/python_modules/libraries/dagster-gcp/dagster_gcp/bigquery/ops.py#L57Akira Chang
04/18/2023, 1:26 PM@asset
def an_asset():
df = bq_op_for_queries("**my queries**")
print(df)
I just want to simply print out the results of my custom query, I get a type OpDefinition
as the result, why is that?Tim Castillo
04/18/2023, 1:36 PMbq_op_for_queries
makes an Op and isn't made to be used within an asset code.
If you're familiar with Airflow, it's like the BigQueryOperator
.
I remember talking to you about the bigquery_resource
and using that to run queries. Did that not fit your needs?Akira Chang
04/18/2023, 1:44 PMDefinition
object when I needed to run queries on my BigQuery tables
So I thought if bq_op_for_queries
would be any simpler. I was also thinking of using class-based resources for querying my tables, it seems that they will be releasing an evolution to the bigquery_resource
this week?Tim Castillo
04/18/2023, 1:45 PMDefinitions
object? In most situations, if you're using load_assets_from_module
, you'd only have to explicitly update your assets in the Definitions
if you made a new Python module.Akira Chang
04/18/2023, 1:50 PM-My_project
-Pipeline1 Folder
- assets.py
-Pipeline2 Folder
-assets.py
-Pipeline3 Folder
-assets.py
-__init__.py
like this, and I have three assets.py
file in three different folders(Pipeline1,2,3), the Definitions
object is defined in the init
file. Can I still use load_assets_from_module
to load all of the assets from all three pipeline folders to the Definitions
object?Tim Castillo
04/18/2023, 1:52 PMDefinitions
object.
Here's an example of how 3 different modules had their assets loaded and the asset groups were all combined together into one Definitions
Tim Castillo
04/18/2023, 1:52 PMAkira Chang
04/18/2023, 1:53 PMAkira Chang
04/18/2023, 2:26 PMdagster dev
in Pipeline_1
I get this error
UserWarning: Error loading repository location Pipeline_1:dagster._core.errors.DagsterInvariantViolationError: No repositories, jobs, pipelines, graphs, asset groups, or asset definitions found in "Pipeline_1".
I've put the Definitions object in the init.py
file under My_project
like we mentioned aboveAkira Chang
04/18/2023, 3:51 PMscaffolds
, sorry I didnt mention that earlier. Does it still work in this case?Tim Castillo
04/18/2023, 3:51 PMdagster dev
from your My_project
directory.