Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR]: Data validation of properties. #6

Closed
arv-anshul opened this issue Oct 12, 2023 · 0 comments · Fixed by #7
Closed

[REFACTOR]: Data validation of properties. #6

arv-anshul opened this issue Oct 12, 2023 · 0 comments · Fixed by #7
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arv-anshul
Copy link
Owner

As you know the fetched data is not well type hinted that's why the streamlit app throw ValidationError which is annoying. So remove the pydantic validation on the fetched data.

😎 A better approach!
# Whole fetched data converted as pd.DataFrame
df = fetched_data_as_dataframe

imp_cols = [
    'PROP_ID', 'PREFERENCE', 'DESCRIPTION', 'PROPERTY_TYPE', 'CITY', 'TRANSACT_TYPE',
    'OWNTYPE', 'CLASS_LABEL', 'BEDROOM_NUM', 'PRICE_PER_UNIT_AREA', 'FURNISH',
    'FACING', 'AGE', 'TOTAL_FLOOR', 'FEATURES', 'PROP_NAME', 'PRICE_SQFT', 'MAP_DETAILS',
    'AMENITIES', 'AREA', 'PRICE', 'PROP_HEADING', 'SECONDARY_TAGS', 'TOTAL_LANDMARK_COUNT',
    'FORMATTED_LANDMARK_DETAILS', 'SOCIETY_NAME', 'BUILDING_NAME', 'location', 'BALCONY_NUM',
    'FLOOR_NUM', 'CARPET_SQFT', 'SUPERBUILTUP_SQFT', 'BUILTUP_SQFT', 'SUPER_SQFT',
]

# Filter the data using the most important columns
df = df[imp_cols]  # Now df contains only important columns

Now, you can provide a multiselect option in the app from that users can choose other important data (column/feature) related to properties. As specified above this method remove the pydantic validation on the fetched data.

@arv-anshul arv-anshul added enhancement New feature or request good first issue Good for newcomers labels Oct 13, 2023
@arv-anshul arv-anshul pinned this issue Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant