def get_eager_datasource(cls, session, datasource_type, datasource_id):
        """Returns datasource with columns and metrics."""
        datasource_class = ConnectorRegistry.sources[datasource_type]
        return (
            session.query(datasource_class)
            .options(
                subqueryload(datasource_class.columns),
                subqueryload(datasource_class.metrics),
            )
            .filter_by(id=datasource_id)
            .one()
        )
def get_eager_datasource ( cls , session , datasource_type , datasource_id ) : datasource_class = ConnectorRegistry . sources [ datasource_type ] return ( session . query ( datasource_class ) . options ( subqueryload ( datasource_class . columns ) , subqueryload ( datasource_class . metrics ) , ) . filter_by ( id = datasource_id ) . one ( ) )
Returns datasource with columns and metrics.