Back to Community
Using Global Domain Calendars on Self-Serve Data


I've uploaded a dataset with daily Brazilian inflation rate and I'm trying to run it through a pipeline with BR_EQUITIES trading calendar. I couldn't set the dataset calendar to comply with Brazilian one.

Does anyone has an idea about how to do so?

start_date = '2017-04-01'  
end_date = '2018-01-01'

calendar = BR_EQUITIES.calendar

# Roll input dates to the next trading session.  
start_date = calendar.minute_to_session_label(pd.Timestamp(start_date, tz='UTC'))  
end_date = calendar.minute_to_session_label(pd.Timestamp(end_date, tz='UTC'))

from quantopian.pipeline import Pipeline  
from quantopian.research import run_pipeline  
from import daily_ipca_rate

daily_ipca_rate.signal.calendar = BR_EQUITIES.calendar

pipe = Pipeline(  
        'my_dataset': daily_ipca_rate.signal.latest  
df = run_pipeline(pipe, start_date, end_date)  
ValueErrorTraceback (most recent call last)  
<ipython-input-21-e40302541cff> in <module>()  
     22     domain=BR_EQUITIES,  
     23 )  
---> 24 df = run_pipeline(pipe, start_date, end_date)  
     25 df.head()

/build/src/qexec_repo/qexec/research/ in run_pipeline(pipeline, start_date, end_date, show_progress, chunksize)
    490             show_progress=show_progress,  
    491             pipeline_engine=pipeline_engine,  
--> 492             holdout_manager=holdout_manager,  
    493         )  
    494     # The docstring is defined at module scope to get correct indentation.

/build/src/qexec_repo/qexec/research/_api.pyc in inner_run_pipeline(pipeline, start_date, end_date, show_progress, chunksize, pipeline_engine, holdout_manager)
    724     """Internal implementation of quantopian.research.run_pipeline.  
    725     """  
--> 726     domain = pipeline_engine.resolve_domain(pipeline)  
    727     adjusted_start_date = domain.roll_forward(start_date)  
    728     adjusted_end_date = domain.roll_forward(end_date)

/build/src/qexec_repo/zipline_repo/zipline/pipeline/engine.pyc in resolve_domain(self, pipeline)
    863         """Resolve a concrete domain for ``pipeline``.  
    864         """  
--> 865         domain = pipeline.domain(default=self._default_domain)  
    866         if domain is GENERIC:  
    867             raise ValueError(

/build/src/qexec_repo/zipline_repo/zipline/pipeline/ in domain(self, default)
    269     def domain(self, default):  
    270         """  
--> 271         Get the domain for this pipeline.  
    273         - If an explicit domain was provided at construction time, use it.

/build/src/qexec_repo/zipline_repo/zipline/pipeline/pipeline.pyc in domain(self, default)
    310                 raise ValueError(  
    311                     "Conflicting domains in Pipeline. Inferred {}, but {} was "  
--> 312                     "passed at construction.".format(inferred, self._domain)  
    313                 )  
    314             return inferred

ValueError: Conflicting domains in Pipeline. Inferred EquityCalendarDomain('US', 'XNYS'), but EquityCalendarDomain('BR', 'BVMF') was passed at construction.  
2 responses

Did you resolve this one? I am facing the same issue with GB_EQUITIES.

I solved my own problem. I am using the Alphalens tutorial 5 quick start template and have converted it to use UK stocks with GB_EQUITIES as the domain. I get the equivalent of the error reported above. However, when I remove the references to sector all is well ie
sector = Sector()

return Pipeline(  
    columns = {'factor_to_analyze': factor_to_analyze},  
    screen = universe & factor_to_analyze.notnull() & **sector.notnull(),**