Skip to content

Commit

Permalink
Merge pull request #51 from UDST/toolz-patch
Browse files Browse the repository at this point in the history
[v1.5.4.dev0] Compatibility updates
  • Loading branch information
smmaurer authored Nov 3, 2020
2 parents 28f67c0 + 8d5352f commit 1d32078
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion orca/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

from .orca import *

version = __version__ = '1.5.3'
version = __version__ = '1.5.4.dev0'
12 changes: 8 additions & 4 deletions orca/orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@
import logging
import time
import warnings
from collections import Callable, namedtuple
from collections import namedtuple
try:
from collections.abc import Callable
except ImportError: # Python 2.7
from collections import Callable
from contextlib import contextmanager
from functools import wraps


import pandas as pd
import tables
import tlz as tz

from . import utils
from .utils.logutil import log_start_finish
from collections import namedtuple

warnings.filterwarnings('ignore', category=tables.NaturalNameWarning)
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -937,8 +941,8 @@ def _collect_variables(names, expressions=None):
expressions = []
offset = len(names) - len(expressions)
labels_map = dict(tz.concatv(
tz.compatibility.zip(names[:offset], names[:offset]),
tz.compatibility.zip(names[offset:], expressions)))
zip(names[:offset], names[:offset]),
zip(names[offset:], expressions)))

all_variables = tz.merge(_INJECTABLES, _TABLES)
variables = {}
Expand Down
2 changes: 1 addition & 1 deletion orca/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def column_csv(table_name, col_name):
Return a column as CSV using Pandas' default CSV output.
"""
csv = orca.get_table(table_name).get_column(col_name).to_csv(path=None)
csv = orca.get_table(table_name).get_column(col_name).to_csv(path_or_buf=None)
return csv, 200, {'Content-Type': 'text/csv'}


Expand Down
7 changes: 4 additions & 3 deletions orca/server/tests/test_server.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import json

import orca
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pandas.testing as pdt
import pytest

from .. import server
Expand Down Expand Up @@ -233,7 +234,7 @@ def test_column_csv(tapp, dfa):
assert rv.status_code == 200

data = rv.data.decode('utf-8')
assert data == dfa.a.to_csv(path=None)
assert data == dfa.a.to_csv(path_or_buf=None)


def test_no_column_404(tapp):
Expand Down Expand Up @@ -420,5 +421,5 @@ def test_table_groupbyagg_level_std(tapp):
pdt.assert_series_equal(
test,
pd.Series(
[pd.np.nan, pd.Series([80, 90]).std()],
[np.nan, pd.Series([80, 90]).std()],
index=['a', 'b'], name='b'))
2 changes: 1 addition & 1 deletion orca/tests/test_orca.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import tempfile

import pandas as pd
import pandas.testing as pdt
import pytest
from pandas.util import testing as pdt

from .. import orca
from ..utils.testing import assert_frames_equal
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def run(self):

setup(
name='orca',
version='1.5.3',
version='1.5.4.dev0',
description='A pipeline orchestration tool with Pandas support',
long_description=long_description,
author='UrbanSim Inc.',
Expand Down

0 comments on commit 1d32078

Please sign in to comment.