-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1623 from finos/partial-update-py
Fix partial-updates on tables with `limit` set for python
- Loading branch information
Showing
3 changed files
with
49 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
python/perspective/perspective/tests/table/test_table_limit.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ***************************************************************************** | ||
# | ||
# Copyright (c) 2019, the Perspective Authors. | ||
# | ||
# This file is part of the Perspective library, distributed under the terms of | ||
# the Apache License 2.0. The full license can be found in the LICENSE file. | ||
# | ||
|
||
import perspective | ||
import six | ||
|
||
from pytest import mark | ||
from datetime import date, datetime | ||
|
||
|
||
class TestTableInfer(object): | ||
|
||
def test_table_limit_wraparound_does_not_respect_partial(self): | ||
t = perspective.Table({'a':float, 'b':float}, limit=3) | ||
t.update([{'a':10}, {'b':1}, {'a':20}, {'a':None,'b':2}]) | ||
df = t.view().to_df() | ||
|
||
t2 = perspective.Table({'a':float, 'b':float}, limit=3) | ||
t2.update([{'a':10}, {'b':1}, {'a':20}, {'b':2}]) | ||
df2 = t2.view().to_df() | ||
|
||
assert df.to_dict() == df2.to_dict() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters