Replies: 1 comment
-
The problem was solved by performing the “Database migration” in the “ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am learning about Dagster's I/O manager.
We are using the old documentation for learning.
I built a learning code with both Asset and Op functions based on the following document and was verifying its operation.
When I was testing the code, I got an “Unexpected GraphQL error” on the “Open launchpad” screen of the job.
Unexpected GraphQL error” occurred on the ‘Open launchpad’ screen of the job.
The situation is as follows:
1. reloading the code location completes without error.
2. execution of the following two jobs from the “Materialize all” button on the Jobs screen completes without error.
iomanager_basic_asset_job
custom_iomanager_basic_asset_job
3. the following error occurs when “Open launchpad” is selected on the Jobs screen for the two jobs created.
Error: Unexpected GraphQL error
The details are described below.
However
The two jobs can be materialized by “Open launchpad”.
Both jobs do not output any errors in the execution log.
As mentioned above, both Materialize and Open launchpad do not generate errors in execution,
I would like to know the cause of the error that appears when the “Open launchpad” screen is displayed.
※ The GraphQL error describes an error related to partitions.
Since we had tried and failed in the “Handling partition mappings” document just before, we thought this might be the cause of the error.
Re-creating the database schema just in case this was the cause,
However, the GraphQL error persisted.
The environment used is as follows.
Python: 3.12.8
Dagster: 1.9.12
DB: PostgreSQL
OS: Windows11
Execution command: dagster dev -f iomanager_learning.py
Documents being studied:
Writing a per-input I/O manager
https://legacy-docs.dagster.io/concepts/io-management/io-managers#writing-a-per-input-io-manager
Code built for learning
import os
import numpy as np
import pandas as pd
from dagster import (
asset,
AssetExecutionContext,
Definitions,
ConfigurableIOManager,
InputContext,
OutputContext,
define_asset_job,
In,
AssetIn,
)
-=-=-=-=-=-=-=-=-=-=-=-=
code01
-=-=-=-=-=-=-=-=-=-=-=-=
@asset
def iomanager_basic_upstream_asset():
return [1, 2, 3]
@asset
def iomanager_basic_downstream_asset(iomanager_basic_upstream_asset):
return iomanager_basic_upstream_asset + [4]
iomanager_basic_asset_job = define_asset_job(
description='code01',
name = 'iomanager_basic_asset_job',
selection=[
iomanager_basic_upstream_asset,
iomanager_basic_downstream_asset
],
)
-=-=-=-=-=-=-=-=-=-=-=-=
code02
-=-=-=-=-=-=-=-=-=-=-=-=
class PandasIOManager(ConfigurableIOManager):
path_prefix: str
@asset(io_manager_key='pandas_manager')
def custom_iomanager_basic_upstream_asset() -> pd.DataFrame:
return pd.DataFrame([1, 2, 3])
@asset(io_manager_key='pandas_manager')
def custom_iomanager_basic_downstream_asset(context: AssetExecutionContext,
custom_iomanager_basic_upstream_asset: pd.DataFrame
) -> pd.DataFrame:
custom_iomanager_basic_upstream_asset.loc['ONE'] = 0
context.log.info(custom_iomanager_basic_upstream_asset)
return pd.DataFrame(custom_iomanager_basic_upstream_asset)
custom_iomanager_basic_asset_job = define_asset_job(
description='code02',
name = 'custom_iomanager_basic_asset_job',
selection=[
custom_iomanager_basic_upstream_asset,
custom_iomanager_basic_downstream_asset,
],
)
-=-=-=-=-=-=-=-=-=-=-=-=
DagsterDefinitions
-=-=-=-=-=-=-=-=-=-=-=-=
defs = Definitions(
assets = [
iomanager_basic_upstream_asset,
iomanager_basic_downstream_asset,
)
Contents of Unexpected GraphQL error
Operation name: {ConfigPartitionsAssetsQuery}
Message: Cannot return null for non-nullable field PartitionKeys.partitionKeys.
Path: ["pipelineOrError","partitionKeysOrError","partitionKeys"]
Locations: [{"line":16,"column":11}]
Stack Trace:
File "D:\pg\workspase.venv.venv_dagster_latest\Lib\site-packages\graphql\execution\execute.py", line 542, in execute_field
completed = self.complete_value(
^^^^^^^^^^^^^^^^^^^^
File "D:\pg\workspase.venv.venv_dagster_latest\Lib\site-packages\graphql\execution\execute.py", line 622, in complete_value
raise TypeError(
Beta Was this translation helpful? Give feedback.
All reactions