Back to Community
Classifier issue within a pipeline (morningstar works, Fundamentals does not)

Hello all,

I am currently learning the pipeline way of doing things with quantopian as my favorite get_fundamentals is about to be depreciated. I have struggled, admittedly, in learning how to implement pipeline methods, so forgive me if this is a super simple question (hope there is a super simple answer).

In particular, I followed the tutorials that describe how to filter based off of classifiers, and this I understand alright. However, I cannot seem to get Fundamentals.growth_grade to cooperate (as Fundamentals.exchange_id does). The problem could be summarized with the following code (notebook attached also):

from quantopian.pipeline import Pipeline  
from quantopian.research import run_pipeline  
from quantopian.pipeline.data import Fundamentals

def make_pipeline():  
    good_xch = Fundamentals.exchange_id.latest.eq('NYS')  
    good_grade = Fundamentals.growth_grade.latest.eq('A')  
    return Pipeline(  
        columns={  
            'good_xch' : good_xch,  
            'good_grd' : good_grade  
        }  
    )

my_pipe = make_pipeline()  
result = run_pipeline(my_pipe, '2017-08-20', '2017-08-20')  

Produces:
TypeError: writable buffers are not hashable.

Edit:
I just noticed that this works with the morningstar namespace, but not the newly introduced Fundamentals namespace.

Many thanks.

Loading notebook preview...
Notebook previews are currently unavailable.
1 response

Hi Richard,

Thanks for sharing this problem. This is a bug in the new system and we're actively working on a fix. The specific bug is triggered in some classifiers in the new Fundamentals namespace.

In the meantime, you can use the morningstar namespace in Pipeline:

from quantopian.pipeline import Pipeline  
from quantopian.research import run_pipeline  
from quantopian.pipeline.data import morningstar

def make_pipeline():  
    good_xch = morningstar. share_class_reference.exchange_id.latest.eq('NYS')  
    good_grade = morningstar.asset_classification.growth_grade.latest.eq('A')  
    return Pipeline(  
        columns={  
            'good_xch' : good_xch,  
            'good_grd' : good_grade  
        }  
    )

my_pipe = make_pipeline()  
result = run_pipeline(my_pipe, '2017-08-20', '2017-08-20')  

If you're interested in knowing the differences between the morningstar Pipeline namespace and the Fundamentals namespace, I recommend checking out this thread. Once we fix the issue with classifiers in the Fundamentals Pipeline namespace, we'll announce it in that thread.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.