Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#222- Dataframe column names autocompletion
- Loading branch information
1 parent
f639410
commit c1dd24a
Showing
4 changed files
with
61 additions
and
1 deletion.
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
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,20 @@ | ||
# Licensed to Elasticsearch B.V under one or more agreements. | ||
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
# See the LICENSE file in the project root for more information | ||
|
||
# File called _pytest for PyCharm compatibility | ||
|
||
|
||
from eland.tests.common import TestData | ||
|
||
|
||
class TestDataFrameDir(TestData): | ||
def test_flights_dir(self): | ||
ed_flights = self.ed_flights() | ||
|
||
print(dir(ed_flights)) | ||
|
||
autocomplete_attrs = dir(ed_flights) | ||
|
||
for c in ed_flights.columns: | ||
assert c in autocomplete_attrs |
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,22 @@ | ||
# Licensed to Elasticsearch B.V under one or more agreements. | ||
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
# See the LICENSE file in the project root for more information | ||
|
||
# File called _pytest for PyCharm compatibility | ||
|
||
from eland.utils import is_valid_attr_name | ||
|
||
class TestUtils: | ||
|
||
def test_is_valid_attr_name(self): | ||
assert is_valid_attr_name('_piZZa') | ||
assert is_valid_attr_name('nice_pizza_with_2_mushrooms') | ||
assert is_valid_attr_name('_2_pizze') | ||
|
||
assert not is_valid_attr_name('_') | ||
assert not is_valid_attr_name('___') | ||
assert not is_valid_attr_name('4') | ||
assert not is_valid_attr_name(4) | ||
assert not is_valid_attr_name(None) | ||
assert not is_valid_attr_name('4pizze') | ||
assert not is_valid_attr_name('pizza+') |
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