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

BulkUpload Fixes #2625

Merged
merged 44 commits into from
Aug 27, 2024
Merged

BulkUpload Fixes #2625

merged 44 commits into from
Aug 27, 2024

Conversation

TaylorFries
Copy link
Collaborator

@TaylorFries TaylorFries commented Aug 14, 2024

🎯 Summary

list of changes:

  • Updated getClassificationOrThrow to match flow of other bulk upload functions.

  • parcel: added:

    • description -> '',
    • isSensitive -> false,
    • isVisibleToOtherAgencies -> true

    as variables that will use the value given in the bulk upload sheet if present, if not it will check if we are updating a parcel, if we are use the old value if we are adding a new parcel set the value to defaults (listed above)

  • building: added:

    • description -> '',
    • rentableArea -> 0,
    • isSensitive -> false,
    • isVisibleToOtherAgencies -> true,
    • buildingFloorCount -> 0,
    • tenancy -> '',
    • totalArea -> 0

    as variables that will use the value given in the bulk upload sheet if present, if not it will check if we are updating a building, if we are use the old value if we are adding a new building set the value to defaults (listed above)

  • updated list of required/ optional headers

  • included check for all required headers to be present

  • included check for multiple buildinfs found with name PID combo

  • removed name field from parcel update/insert

  • updated how IsSensitive and IsVisableToOtherAgencies is determined

  • Removed test for active vs. non active statuses and all references to status in testing function for getClassificationOrThrow.

Some things to note:

  • Will the people curating these sheets to be uploaded know the agencyCode?
  • Assessed, AssessedYear, NetBook, FiscalYear can add new values but not update old ones.
    • They also can only add one new value.

Testing

try uploading a spreadsheet with bulk upload. Please check if all possible fields update correctly and new properties get added correctly. Bulk upload should be able to add new parcels or buildings as well as update any of the fields (excluding PID and name)
To test how the bulk upload handles matching building name/PID combo I used this query:

SELECT PID, name, count from 
  (SELECT PID, name, COUNT(*) as count
  from building
  group by PID, name) as T1
where count > 2;

On my local database to get a list of buildings that have name PID duplicates. Then i created a test upload file for a building with that name and pid.

🔰 Checklist

  • I have read and agree with the following checklist and am following the guidelines in our Code of Conduct document.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation where required.
  • I have tested my changes to the best of my ability.
  • My changes generate no new warnings.

Copy link

🚀 Deployment Information

The Express API Image has been built with the tag: 2625. Please make sure to utilize this specific tag when promoting these changes to the TEST and PROD environments during the API deployment. For more updates please monitor Image Tags Page on Wiki.

Copy link

codeclimate bot commented Aug 14, 2024

Code Climate has analyzed commit 3f7c3ed and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

The test coverage on the diff in this pull request is 80.8% (50% is the threshold).

This pull request will bring the total coverage in the repository to 93.3%.

View more on Code Climate.

@TaylorFries TaylorFries marked this pull request as draft August 14, 2024 21:33
@TaylorFries TaylorFries changed the title Quick Fix for getClassificationOrThrow BulkUpload Fixes Aug 15, 2024
Copy link
Collaborator

@dbarkowsky dbarkowsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the name field back in, but it should use the existing building's name first, otherwise use the name from the row. This way, it's not going to update the record's name field, but it should allow a building to be inserted with a name, which is what we'd expect given it's a mandatory field.

@TaylorFries TaylorFries merged commit b931729 into main Aug 27, 2024
13 checks passed
@TaylorFries TaylorFries deleted the bulkupload-classification-quick-fix branch August 27, 2024 22:53
dbarkowsky added a commit that referenced this pull request Sep 11, 2024
Co-authored-by: dbarkowsky <dylanbarkowsky@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants