Skip to content

Commit

Permalink
added all columns
Browse files Browse the repository at this point in the history
  • Loading branch information
am-tropin committed Nov 17, 2023
1 parent 33df2e0 commit 0acf4a0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 44 deletions.
33 changes: 13 additions & 20 deletions app/tests/.ipynb_checkpoints/test_function_store-checkpoint.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"id": "c4bf99d5",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -77,7 +77,11 @@
"\n",
"@pytest.mark.mandatory\n",
"def test_column_names(grab_test_file):\n",
" required_names = {'floor', 'rooms', 'city', 'district', 'radius'}\n",
" required_names = {'Unnamed: 0.1', 'Unnamed: 0', 'id', 'city', 'floor', 'latitude',\n",
" 'longitude', 'price', 'rooms', 'sq', 'year', 'latitude_center',\n",
" 'longitude_center', 'decade', 'price_per_m', 'sq_round', 'radius',\n",
" 'radius_dec', 'radius_ceil', 'district'}\n",
"# {'floor', 'rooms', 'city', 'district', 'radius'}\n",
" dt.validate(grab_test_file.columns, required_names)\n",
"# https://github.com/shawnbrown/datatest/blob/bf136eab23c2b6ea36c201e1446fca9243c3fba6/docs/intro/automated-testing.rst#L139\n"
]
Expand Down Expand Up @@ -188,7 +192,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "59add23f",
"id": "6f68e744",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -202,23 +206,23 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d156ca82",
"id": "89d67440",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "c2cb977c",
"id": "86521164",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "55ee66be",
"id": "97872ace",
"metadata": {},
"outputs": [],
"source": []
Expand Down Expand Up @@ -266,24 +270,13 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 12,
"id": "ec723882",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(4315, 20)"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# test_df = pd.read_csv('test_file.csv')\n",
"# test_df.shape"
"# test_df.columns"
]
},
{
Expand Down
33 changes: 13 additions & 20 deletions app/tests/test_function_store.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 10,
"id": "c4bf99d5",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -77,7 +77,11 @@
"\n",
"@pytest.mark.mandatory\n",
"def test_column_names(grab_test_file):\n",
" required_names = {'floor', 'rooms', 'city', 'district', 'radius'}\n",
" required_names = {'Unnamed: 0.1', 'Unnamed: 0', 'id', 'city', 'floor', 'latitude',\n",
" 'longitude', 'price', 'rooms', 'sq', 'year', 'latitude_center',\n",
" 'longitude_center', 'decade', 'price_per_m', 'sq_round', 'radius',\n",
" 'radius_dec', 'radius_ceil', 'district'}\n",
"# {'floor', 'rooms', 'city', 'district', 'radius'}\n",
" dt.validate(grab_test_file.columns, required_names)\n",
"# https://github.com/shawnbrown/datatest/blob/bf136eab23c2b6ea36c201e1446fca9243c3fba6/docs/intro/automated-testing.rst#L139\n"
]
Expand Down Expand Up @@ -188,7 +192,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "59add23f",
"id": "6f68e744",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -202,23 +206,23 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d156ca82",
"id": "89d67440",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "c2cb977c",
"id": "86521164",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "55ee66be",
"id": "97872ace",
"metadata": {},
"outputs": [],
"source": []
Expand Down Expand Up @@ -266,24 +270,13 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 12,
"id": "ec723882",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(4315, 20)"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"# test_df = pd.read_csv('test_file.csv')\n",
"# test_df.shape"
"# test_df.columns"
]
},
{
Expand Down
12 changes: 8 additions & 4 deletions app/tests/test_function_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pytest


# In[11]:
# In[10]:


import pandas as pd
Expand Down Expand Up @@ -62,7 +62,11 @@ def grab_test_file():

@pytest.mark.mandatory
def test_column_names(grab_test_file):
required_names = {'floor', 'rooms', 'city', 'district', 'radius'}
required_names = {'Unnamed: 0.1', 'Unnamed: 0', 'id', 'city', 'floor', 'latitude',
'longitude', 'price', 'rooms', 'sq', 'year', 'latitude_center',
'longitude_center', 'decade', 'price_per_m', 'sq_round', 'radius',
'radius_dec', 'radius_ceil', 'district'}
# {'floor', 'rooms', 'city', 'district', 'radius'}
dt.validate(grab_test_file.columns, required_names)
# https://github.com/shawnbrown/datatest/blob/bf136eab23c2b6ea36c201e1446fca9243c3fba6/docs/intro/automated-testing.rst#L139

Expand Down Expand Up @@ -208,11 +212,11 @@ def test_2_parameter_product():
# https://stackoverflow.com/questions/22472213/python-random-selection-per-group


# In[17]:
# In[12]:


# test_df = pd.read_csv('test_file.csv')
# test_df.shape
# test_df.columns


# In[ ]:
Expand Down

0 comments on commit 0acf4a0

Please sign in to comment.