Ticket: Facet Search errors

I am having a hard time trying to figure out whats the problem. When i run pytest -m facets , it gives me the following errors:

Traceback (most recent call last):
  File "c:\users\tonyyy\anaconda3\lib\site-packages\_pytest\config.py", line 327, in _getconftestmodules
    return self._path2confmods[path]
KeyError: local('C:\\Users\\Tonyyy\\Desktop\\mongodbCOURSES\\mflix220\\mflix-python\\tests')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "c:\users\tonyyy\anaconda3\lib\site-packages\_pytest\config.py", line 358, in _importconftest
    return self._conftestpath2mod[conftestpath]
KeyError: local('C:\\Users\\Tonyyy\\Desktop\\mongodbCOURSES\\mflix220\\mflix-python\\tests\\conftest.py')

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "c:\users\tonyyy\anaconda3\lib\site-packages\_pytest\config.py", line 364, in _importconftest
    mod = conftestpath.pyimport()
  File "c:\users\tonyyy\anaconda3\lib\site-packages\py\_path\local.py", line 701, in pyimport
    __import__(modname)
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 668, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 638, in _load_backward_compatible
  File "c:\users\tonyyy\anaconda3\lib\site-packages\_pytest\assertion\rewrite.py", line 212, in load_module
    py.builtin.exec_(co, mod.__dict__)
  File "C:\Users\Tonyyy\Desktop\mongodbCOURSES\mflix220\mflix-python\tests\conftest.py", line 2, in <module>
    from mflix.factory import create_app
  File "C:\Users\Tonyyy\Desktop\mongodbCOURSES\mflix220\mflix-python\mflix\factory.py", line 12, in <module>
    from mflix.api.movies import movies_api_v1
  File "C:\Users\Tonyyy\Desktop\mongodbCOURSES\mflix220\mflix-python\mflix\api\movies.py", line 2, in <module>
    from mflix.db import get_movie, get_movies, get_movies_by_country, \
  File "C:\Users\Tonyyy\Desktop\mongodbCOURSES\mflix220\mflix-python\mflix\db.py", line 156
    pipeline.append(facet_stage)
                               ^
TabError: inconsistent use of tabs and spaces in indentation
ERROR: could not load C:\Users\Tonyyy\Desktop\mongodbCOURSES\mflix220\mflix-python\tests\conftest.py

I have already read similar posts concerning this ticket but no one seems to be having the same error as me. Anyone have a clue on what the issue is? Thanks!

My code for this part is:

#pipeline = [] 
	
pipeline.append(skip_stage)
pipeline.append(limit_stage)
pipeline.append(facet_stage)

The error is because of this “TabError: inconsistent use of tabs and spaces in indentation”. Python is very sensitive to indentation, I had to switch to TextPad editor to get the indentation of new line correct.

the comment part was correct

Thanks. I am going to try your method tomorrow. If error still persist, i am just going to skip it and come back to it later. Appreciate the help!

@Tony_10287 you can fix this very quickly on your IDE/code editor:

https://www.google.com/search?q=replace+tabs+with+spaces+in&oq=replace+tabs+with+spaces+in+

N.

With the help of @Rehan_53805 and @Norberto i was able to fix it by using a python IDE (pycharm or any). I was doing the work in notepad++ which was causing the errors. Thanks for the help guys!