Ejemplo n.º 1
0
 def build(
     cls, path_locator: "PathLocator", schema: "Schema", name: str,
     mappings: Dict
 ):  # type: ignore # Signature of "build" incompatible with supertype "Step"
     scan_subclasses: Dict[str, Type] = load(cls)
     instance_subclass: Type = scan_subclasses[name]
     return instance_subclass(**mappings, schema=schema)
Ejemplo n.º 2
0
 def build(cls, path_locator, schema: Schema, name: str, subjects: Dict):
     logging.info('Building instance of filter class "%s"' % name)
     filters = load(cls)
     variables = {
         var_name: schema.get(var_id)
         for var_name, var_id in subjects.items()
     }
     return filters[name](schema=schema, **variables)
Ejemplo n.º 3
0
    def __init__(self, context: "Context", change_specs: List[Dict],
                 schema: "Schema", requested_lookups: Optional[List[str]]):

        self.change_classes: Dict[str, Type] = load(Change)
        self.requested_lookups: List[str] = requested_lookups or []
        self.change_specs: List[Dict] = change_specs
        self.schema: "Schema" = schema
        self.context: "Context" = context
Ejemplo n.º 4
0
 def build(cls, path_locator: "PathLocator", schema: "Schema", name: str,
           subjects: Dict):
     scan_subclasses: Dict[str, Type] = load(cls)
     variables: Dict[str, Variable] = {
         var_name: schema.get(var_id)
         for var_name, var_id in subjects.items()
     }
     instance_subclass: Type = scan_subclasses[name]
     return instance_subclass(**variables, schema=schema)
Ejemplo n.º 5
0
    def __init__(self, path_locator: "PathLocator",
                 change_specs: List[Dict],
                 schema: "Schema",
                 requested_lookups: Optional[List[str]]):

        self.change_classes: Dict[str, Type] = load(Change)
        self.requested_lookups: List[str] = requested_lookups or []
        self.change_specs: List[Dict] = change_specs
        self.schema: "Schema" = schema
        self.path_locator: "PathLocator" = path_locator
Ejemplo n.º 6
0
 def build(  # type: ignore # Signature of "build" incompatible with supertype "Step"
         cls, context: Context, schema: Schema, name: str,
         target_schema: str, id_var: str, **kwargs):
     target_schema_instance: Optional[Schema] = Schema.load(
         target_schema, context.schemas_dir)
     aggregations: Dict[str, Type] = load(cls)
     return aggregations[name](context=context,
                               origin_schema=schema,
                               target_schema=target_schema_instance,
                               id_var=id_var,
                               **kwargs)
Ejemplo n.º 7
0
 def build(
         cls, path_locator: PathLocator, schema: Schema, name: str, target_schema: str, id_var: str,
         input_schema_vars: Dict, output_schema_vars: Dict
 ): 
     target_schema_instance: Schema = Schema.load(path_locator, target_schema)
     aggregations: Dict[str, Type] = load(cls)
     input_variables: Dict[str, Variable] = {
         var_name: schema.get(var_id)
         for var_name, var_id in input_schema_vars.items()
     }
     output_variables: Dict[str, Variable] = {
         var_name: target_schema_instance.get(var_id)
         for var_name, var_id in output_schema_vars.items()
     }
     return aggregations[name](origin_schema=schema, target_schema=target_schema_instance, id_var=id_var,
                               **input_variables, **output_variables)
Ejemplo n.º 8
0
 def build(cls, context: Context, schema: Schema, name: str, **kwargs: Any) -> "Filter":  # type: ignore
     logging.info('Building instance of filter class "%s"' % name)
     filters = load(cls)
     filter_class = filters[name]
     return filter_class.build_filter(filter_class, context, schema, **kwargs)
Ejemplo n.º 9
0
 def build(
     cls, path_locator, schema: Schema, name: str, mappings: Dict
 ):  # type: ignore # Signature of "build" incompatible with supertype "Step"
     logging.info('Building instance of filter class "%s"' % name)
     filters = load(cls)
     return filters[name](schema=schema, **mappings)
Ejemplo n.º 10
0
 def build(
     cls, context: Context, schema: Schema, name: str, **kwargs
 ):  # type: ignore # Signature of "build" incompatible with supertype "Step"
     consumes = load(cls)
     return consumes[name](context, schema, **kwargs)
Ejemplo n.º 11
0
 def build(cls, path_locator: PathLocator, schema: Schema, name: str,
           **kwargs):
     consumes = load(cls)
     return consumes[name](path_locator, schema, **kwargs)
Ejemplo n.º 12
0
 def build(
     cls, path_locator: PathLocator, schema: Schema, name: str, **kwargs
 ):  # type: ignore # Signature of "build" incompatible with supertype "Step"
     consumes = load(cls)
     return consumes[name](path_locator, schema, **kwargs)
Ejemplo n.º 13
0
 def build(cls, context: "Context", schema: "Schema", name: str, **kwargs):  # type: ignore # Signature of "build" incompatible with supertype "Step"
     scan_subclasses: Dict[str, Type] = load(cls)
     instance_subclass: Type = scan_subclasses[name]
     return instance_subclass(**kwargs, schema=schema, context=context)
Ejemplo n.º 14
0
 def build(cls, context: Context, schema: Schema, name: str,
           **kwargs):  # type: ignore
     logging.info('Building instance of filter class "%s"' % name)
     filters = load(cls)
     return filters[name](context=context, schema=schema, **kwargs)