Skip to content

allow for expressing invariance rules and optimizations around them #34

@dwiel

Description

@dwiel

In some cases I've written rules like this:

@gc.rule(['location.id'], 'location.location_months.location.id')                
def location_location_months_location_id(id):                                    
    return id

Because this transformation is opaque to graphcore (it sees it as a python function) and so can't optimize across that boundary as in this case:

location.location_months.location.date_of_first_email = <SQLQuery tables:locations; selects:locations.date_of_first_email; where:{} input_mapping:{'id': 'locations.id'}; limit:None; one_column:True; first:True>(location.location_months.location.id) 
location.establishment_type.name, location.name, location.establishment_type.id, location.house_state, location.id = <SQLQuery tables:establishment_types, locations; selects:establishment_types.name, locations.name, locations.establishment_type_id, locations.house_state, locations.id; where:{'locations.house_state': 'release', 'establishment_types.id': 'locations.establishment_type_id'} input_mapping:{}; limit:None; one_column:False; first:False>() Cardinality.many 

these SQLQueries should be mergable, but since there is this python function inbetween, it can't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions