Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sfermigier committed Apr 15, 2019
1 parent 3f900e0 commit be077a8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ lint: lint-python

lint-python:
@echo "--> Linting Python files"
flake8
flake8 olapy tests

@make lint-py3k

Expand Down
10 changes: 5 additions & 5 deletions micro_bench/olapy_pandas_VS_olapy_pyspark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
from importlib import reload
from pprint import pprint

from .benchmark_tools import BENCH_CUBE, run_benchmark, save_benchmark_result

from olapy.core.mdx.executor import MdxEngine
from olapy.core.services import XmlaDiscoverReqHandler, XmlaExecuteReqHandler

from .benchmark_tools import BENCH_CUBE, run_benchmark, save_benchmark_result


def benchmark():
mdx_executor = MdxEngine(
cubes_folder="cubes_templates", olapy_data_location="../../../olapy"
)
mdx_executor.load_cube(BENCH_CUBE)
Xmla_discover_request_handler = XmlaDiscoverReqHandler(mdx_executor)
Xmla_execute_request_handler = XmlaExecuteReqHandler(mdx_executor)
xmla_discover_request_handler = XmlaDiscoverReqHandler(mdx_executor)
xmla_execute_request_handler = XmlaExecuteReqHandler(mdx_executor)

return run_benchmark(
mdx_executor, Xmla_discover_request_handler, Xmla_execute_request_handler
mdx_executor, xmla_discover_request_handler, xmla_execute_request_handler
)


Expand Down
11 changes: 6 additions & 5 deletions micro_bench/olapy_pandas_VS_olapy_pyspark/benchmark_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import matplotlib.pyplot as plt
import numpy as np
from cpuinfo import cpuinfo
from mdx_queries import query1, query2, query3
from olap.xmla import xmla
from prettytable import PrettyTable
from spyne.server.wsgi import WsgiApplication

from olapy.core.services.xmla import get_spyne_app

from .mdx_queries import query1, query2, query3

HOST = "127.0.0.1"
PORT = 8000
BENCH_CUBE = "foodmart"
Expand Down Expand Up @@ -75,20 +76,20 @@ def olapy_xmla_benchmark(queries):
return execution_time_results


def get_olapy_server(Xmla_discover_request_handler, Xmla_execute_request_handler):
def get_olapy_server(xmla_discover_request_handler, xmla_execute_request_handler):
application = get_spyne_app(
Xmla_discover_request_handler, Xmla_execute_request_handler
xmla_discover_request_handler, xmla_execute_request_handler
)
wsgi_application = WsgiApplication(application)
return WSGIServer(application=wsgi_application, host=HOST, port=PORT)


def run_benchmark(
mdx_engine, Xmla_discover_request_handler, Xmla_execute_request_handler
mdx_engine, xmla_discover_request_handler, xmla_execute_request_handler
):
results = {}
server = get_olapy_server(
Xmla_discover_request_handler, Xmla_execute_request_handler
xmla_discover_request_handler, xmla_execute_request_handler
)
server.start()

Expand Down
2 changes: 1 addition & 1 deletion olapy/core/services/xmla.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def Discover(ctx, request):
and ctx.transport.req_env["QUERY_STRING"] != "admin"
):
raise InvalidCredentialsError(
fault_string="You do not have permission to access this resource",
fault_string="You do not have permission to access this resource"
)

method_name = request.RequestType.lower() + "_response"
Expand Down
1 change: 1 addition & 0 deletions tests/test_xmla_lib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- encoding: utf8 -*-

from olapy.core.services.xmla_lib import get_response


Expand Down

0 comments on commit be077a8

Please sign in to comment.