question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect results for listings grouped in the same development

See original GitHub issue

When we find grouped listings in a search, the price is returned as “from x” where x is the lowest price in the development. Similarly in such cases the number of bedrooms we get back contains all those in the development e.g. “1, 2, 3 & 4 bed”, and the number of bathrooms is not obtained at all. For example if we run the following example with a minimum price of 7500:

import pandas as pd
from daftlistings import Daft, Location, SearchType, PropertyType, SortType, MapVisualization
 
daft = Daft()
daft.set_location(Location.DUBLIN)
daft.set_search_type(SearchType.RESIDENTIAL_RENT)
daft.set_property_type(PropertyType.APARTMENT)
daft.set_sort_type(SortType.PRICE_DESC)
daft.set_min_price(7500)

listings = daft.search()

# cache the listings in the local file
with open("result.txt", "w") as fp:
    fp.writelines("%s\n" % listing.as_dict_for_mapping() for listing in listings)

# read from the local file
with open("result.txt") as fp:
  lines = fp.readlines()

properties = []
for line in lines:
  properties.append(eval(line))

df = pd.DataFrame(properties)
print(df)

The results look like:

daft1

i.e. We are mostly finding prices not satisfying our search criteria.

If we go to the daft link for the second result we find:

daft2

i.e. The reason is that there are properties satisfying the search requirements in the development, but the entire development is returned as a single listing so we don’t distinguish between these properties leading to incorrect results.

I have a fix ready for this that expands such listings so that each property within the development becomes a separate listing and I’ll be ready to pull request it soon.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
EricNevillecommented, Apr 8, 2021

In my experience using the actual site, for some searches quite a lot are grouped in this way, so I’m not sure how good it would be to remove them. The search does return the necessary information on these sub listings to make them into individual listings. The fix I had previously put a pull request in for does actually work in the case of house and apartment searches. it just threw up an error I hadn’t anticipated in the case of studios because they have no numBedrooms. It should be easy enough to work around though I think. I was planning to look into this tomorrow or Saturday, I just didn’t have time when I first realised the problem. It should work though to expand them out into individual listings instead of removing them.

0reactions
AnthonyBloomercommented, Apr 8, 2021

From taking a look into this, it appears Daft returns listings sorted by premium and featured developments (looks like paid advertisements to me). One way around this would be to omit those results from the listings object that is returned. This could potentially yield more accurate results. What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rich result status reports - Search Console Help
These reports show rich result items, not pages (one page can host one or more structured data items of the same or different...
Read more >
SAT Practice Test #7 Answer Explanations
Choice D is incorrect because in the passage, Tocqueville never claims that treating men and women the same would result in superfluous privileges...
Read more >
Lanvin Group Debuts on NYSE under Ticker "LANV"
The proceeds of the transaction will be used to accelerate the organic growth of the Group's brand portfolio and to fund strategic acquisitions ......
Read more >
Known issues with Microsoft Graph
This article describes known issues and limitations with Microsoft Graph and provides workarounds when possible.
Read more >
Publication 1586 (Rev. 7-2022) - IRS
If the payer also receives penalty notices 972CG for. Page 9. 6 missing/incorrect TINs under IRC 6721 for the same payees either during...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found