Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDX parsing? #38

Open
alexaurea opened this issue Feb 8, 2022 · 0 comments
Open

MDX parsing? #38

alexaurea opened this issue Feb 8, 2022 · 0 comments

Comments

@alexaurea
Copy link

alexaurea commented Feb 8, 2022

I'm trying to create a simple MDX example using a db backend, but I'm constantly getting "NoneType" is not ..... and the reason seams (at least on first sight) that olapy can't parse the query properly. (See the screenshot of a debug session).

The query is rather simple:

database_uri_with_no_db = f"postgresql+psycopg2://{config.DB_USER}:{config.DB_PASSWORD}@{config.DB_HOST}:{config.DB_PORT}"
os.environ["SQLALCHEMY_DATABASE_URI "] = database_uri_with_no_db
executor = MdxEngine(source_type="db", sqla_engine=db_engine, cube="accounts")
query = """
SELECT
    { [amount] }  ON COLUMNS,
    { [account]  }  ON ROWS
FROM {accounts}
"""
df = executor.execute_mdx(query)['result']

What am I doing incorrectly?

image

(The actual error I'm getting when running the example is

Traceback (most recent call last):
  File "W:\src\exampple\mdx.py", line 18, in <module>
    df = executor.execute_mdx(query)['result']
  File "C:\Python39\lib\site-packages\olapy\core\mdx\executor\execute.py", line 799, in execute_mdx
    self.star_schema_dataframe[self.selected_measures].sum().to_frame().T
TypeError: 'NoneType' object is not subscriptable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant