Differential D8681 Diff 40806 python_modules/dagster-graphql/dagster_graphql/implementation/utils.py
Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster-graphql/dagster_graphql/implementation/utils.py
import sys | import sys | ||||
from collections import namedtuple | from collections import namedtuple | ||||
from dagster import check | from dagster import check | ||||
from dagster.core.host_representation import PipelineSelector | from dagster.core.host_representation import PipelineSelector | ||||
from dagster.utils.error import serializable_error_info_from_exc_info | from dagster.utils.error import serializable_error_info_from_exc_info | ||||
from ..schema.errors import GrapheneReadOnlyError | |||||
def check_read_only(fn): | def check_read_only(fn): | ||||
def _fn(self, graphene_info, *args, **kwargs): # pylint: disable=unused-argument | def _fn(self, graphene_info, *args, **kwargs): # pylint: disable=unused-argument | ||||
from dagster_graphql.schema.errors import GrapheneReadOnlyError | |||||
dgibson: I thought you preferred relative imports - not when they're inline? | |||||
if graphene_info.context.read_only: | if graphene_info.context.read_only: | ||||
raise UserFacingGraphQLError(GrapheneReadOnlyError()) | raise UserFacingGraphQLError(GrapheneReadOnlyError()) | ||||
return fn(self, graphene_info, *args, **kwargs) | return fn(self, graphene_info, *args, **kwargs) | ||||
return _fn | return _fn | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |
I thought you preferred relative imports - not when they're inline?